@world-engines/protocol-ts 0.1.0-alpha.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.
Files changed (74) hide show
  1. package/LICENSE +46 -0
  2. package/dist/entity-prop-envelope.d.ts +36 -0
  3. package/dist/entity-prop-envelope.js +50 -0
  4. package/dist/gen/v1/auth.d.ts +46 -0
  5. package/dist/gen/v1/auth.js +278 -0
  6. package/dist/gen/v1/billing.d.ts +71 -0
  7. package/dist/gen/v1/billing.js +521 -0
  8. package/dist/gen/v1/common.d.ts +65 -0
  9. package/dist/gen/v1/common.js +387 -0
  10. package/dist/gen/v1/llm.d.ts +317 -0
  11. package/dist/gen/v1/llm.js +3557 -0
  12. package/dist/gen/v1/mcp.d.ts +373 -0
  13. package/dist/gen/v1/mcp.js +3190 -0
  14. package/dist/gen/v1/moderation.d.ts +51 -0
  15. package/dist/gen/v1/moderation.js +368 -0
  16. package/dist/gen/v1/neutral_scenario_source.d.ts +80 -0
  17. package/dist/gen/v1/neutral_scenario_source.js +569 -0
  18. package/dist/gen/v1/relation_kind.d.ts +105 -0
  19. package/dist/gen/v1/relation_kind.js +562 -0
  20. package/dist/gen/v1/rest/admin.d.ts +432 -0
  21. package/dist/gen/v1/rest/admin.js +4957 -0
  22. package/dist/gen/v1/rest/asset.d.ts +205 -0
  23. package/dist/gen/v1/rest/asset.js +2200 -0
  24. package/dist/gen/v1/rest/auth.d.ts +275 -0
  25. package/dist/gen/v1/rest/auth.js +2896 -0
  26. package/dist/gen/v1/rest/billing.d.ts +101 -0
  27. package/dist/gen/v1/rest/billing.js +866 -0
  28. package/dist/gen/v1/rest/common.d.ts +179 -0
  29. package/dist/gen/v1/rest/common.js +1358 -0
  30. package/dist/gen/v1/rest/creator.d.ts +354 -0
  31. package/dist/gen/v1/rest/creator.js +4169 -0
  32. package/dist/gen/v1/rest/messaging.d.ts +190 -0
  33. package/dist/gen/v1/rest/messaging.js +2017 -0
  34. package/dist/gen/v1/rest/moderation.d.ts +61 -0
  35. package/dist/gen/v1/rest/moderation.js +569 -0
  36. package/dist/gen/v1/rest/pet.d.ts +98 -0
  37. package/dist/gen/v1/rest/pet.js +698 -0
  38. package/dist/gen/v1/rest/project_transfer.d.ts +470 -0
  39. package/dist/gen/v1/rest/project_transfer.js +5266 -0
  40. package/dist/gen/v1/rest/scenario.d.ts +756 -0
  41. package/dist/gen/v1/rest/scenario.js +8768 -0
  42. package/dist/gen/v1/rest/stock_bounty.d.ts +154 -0
  43. package/dist/gen/v1/rest/stock_bounty.js +1547 -0
  44. package/dist/gen/v1/rest/stocks.d.ts +465 -0
  45. package/dist/gen/v1/rest/stocks.js +5200 -0
  46. package/dist/gen/v1/rest/support_ticket.d.ts +61 -0
  47. package/dist/gen/v1/rest/support_ticket.js +511 -0
  48. package/dist/gen/v1/rest/users.d.ts +292 -0
  49. package/dist/gen/v1/rest/users.js +2879 -0
  50. package/dist/gen/v1/rest/violations.d.ts +52 -0
  51. package/dist/gen/v1/rest/violations.js +338 -0
  52. package/dist/gen/v1/sav.d.ts +987 -0
  53. package/dist/gen/v1/sav.js +12327 -0
  54. package/dist/gen/v1/save.d.ts +68 -0
  55. package/dist/gen/v1/save.js +595 -0
  56. package/dist/gen/v1/scenario_part_source.d.ts +94 -0
  57. package/dist/gen/v1/scenario_part_source.js +913 -0
  58. package/dist/gen/v1/session.d.ts +49 -0
  59. package/dist/gen/v1/session.js +311 -0
  60. package/dist/gen/v1/view_state.d.ts +267 -0
  61. package/dist/gen/v1/view_state.js +3239 -0
  62. package/dist/gen/v1/world.d.ts +82 -0
  63. package/dist/gen/v1/world.js +707 -0
  64. package/dist/gen/v1/world_memory.d.ts +545 -0
  65. package/dist/gen/v1/world_memory.js +5816 -0
  66. package/dist/gen/v1/world_memory_privacy.d.ts +96 -0
  67. package/dist/gen/v1/world_memory_privacy.js +994 -0
  68. package/dist/gen/v1/ws_frame.d.ts +1626 -0
  69. package/dist/gen/v1/ws_frame.js +18253 -0
  70. package/dist/index.d.ts +2 -0
  71. package/dist/index.js +5 -0
  72. package/dist/ladybug-extraction.d.ts +36 -0
  73. package/dist/ladybug-extraction.js +1 -0
  74. package/package.json +65 -0
@@ -0,0 +1,2879 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.0
4
+ // protoc unknown
5
+ // source: v1/rest/users.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { ErrorInfo } from "../common.js";
9
+ /** 背景槽位引用 区分目录装饰与剧本 CG */
10
+ export var BackgroundKind;
11
+ (function (BackgroundKind) {
12
+ BackgroundKind[BackgroundKind["BACKGROUND_KIND_UNSPECIFIED"] = 0] = "BACKGROUND_KIND_UNSPECIFIED";
13
+ BackgroundKind[BackgroundKind["BACKGROUND_KIND_COSMETIC"] = 1] = "BACKGROUND_KIND_COSMETIC";
14
+ BackgroundKind[BackgroundKind["BACKGROUND_KIND_CG"] = 2] = "BACKGROUND_KIND_CG";
15
+ BackgroundKind[BackgroundKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
16
+ })(BackgroundKind || (BackgroundKind = {}));
17
+ export function backgroundKindFromJSON(object) {
18
+ switch (object) {
19
+ case 0:
20
+ case "BACKGROUND_KIND_UNSPECIFIED":
21
+ return BackgroundKind.BACKGROUND_KIND_UNSPECIFIED;
22
+ case 1:
23
+ case "BACKGROUND_KIND_COSMETIC":
24
+ return BackgroundKind.BACKGROUND_KIND_COSMETIC;
25
+ case 2:
26
+ case "BACKGROUND_KIND_CG":
27
+ return BackgroundKind.BACKGROUND_KIND_CG;
28
+ case -1:
29
+ case "UNRECOGNIZED":
30
+ default:
31
+ return BackgroundKind.UNRECOGNIZED;
32
+ }
33
+ }
34
+ export function backgroundKindToJSON(object) {
35
+ switch (object) {
36
+ case BackgroundKind.BACKGROUND_KIND_UNSPECIFIED:
37
+ return "BACKGROUND_KIND_UNSPECIFIED";
38
+ case BackgroundKind.BACKGROUND_KIND_COSMETIC:
39
+ return "BACKGROUND_KIND_COSMETIC";
40
+ case BackgroundKind.BACKGROUND_KIND_CG:
41
+ return "BACKGROUND_KIND_CG";
42
+ case BackgroundKind.UNRECOGNIZED:
43
+ default:
44
+ return "UNRECOGNIZED";
45
+ }
46
+ }
47
+ function createBaseUserPublicProfile() {
48
+ return {
49
+ user_id: "",
50
+ display_name: "",
51
+ discriminator: 0,
52
+ avatar_url: undefined,
53
+ bio: undefined,
54
+ joined_at: "0",
55
+ scenarios_published: "0",
56
+ total_plays: "0",
57
+ title: undefined,
58
+ loadout: undefined,
59
+ owned_cosmetics: [],
60
+ status: undefined,
61
+ showcase: [],
62
+ owned_badges: [],
63
+ error: undefined,
64
+ pinned_badges: [],
65
+ _unknownFields: {},
66
+ };
67
+ }
68
+ export const UserPublicProfile = {
69
+ encode(message, writer = new BinaryWriter()) {
70
+ if (message.user_id !== "") {
71
+ writer.uint32(10).string(message.user_id);
72
+ }
73
+ if (message.display_name !== "") {
74
+ writer.uint32(18).string(message.display_name);
75
+ }
76
+ if (message.discriminator !== 0) {
77
+ writer.uint32(24).int32(message.discriminator);
78
+ }
79
+ if (message.avatar_url !== undefined) {
80
+ writer.uint32(34).string(message.avatar_url);
81
+ }
82
+ if (message.bio !== undefined) {
83
+ writer.uint32(42).string(message.bio);
84
+ }
85
+ if (message.joined_at !== "0") {
86
+ writer.uint32(48).int64(message.joined_at);
87
+ }
88
+ if (message.scenarios_published !== "0") {
89
+ writer.uint32(56).int64(message.scenarios_published);
90
+ }
91
+ if (message.total_plays !== "0") {
92
+ writer.uint32(64).int64(message.total_plays);
93
+ }
94
+ if (message.title !== undefined) {
95
+ writer.uint32(74).string(message.title);
96
+ }
97
+ if (message.loadout !== undefined) {
98
+ ProfileLoadout.encode(message.loadout, writer.uint32(82).fork()).join();
99
+ }
100
+ for (const v of message.owned_cosmetics) {
101
+ UserCosmeticItem.encode(v, writer.uint32(90).fork()).join();
102
+ }
103
+ if (message.status !== undefined) {
104
+ writer.uint32(98).string(message.status);
105
+ }
106
+ for (const v of message.showcase) {
107
+ ShowcaseItem.encode(v, writer.uint32(106).fork()).join();
108
+ }
109
+ for (const v of message.owned_badges) {
110
+ UserBadge.encode(v, writer.uint32(114).fork()).join();
111
+ }
112
+ if (message.error !== undefined) {
113
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
114
+ }
115
+ for (const v of message.pinned_badges) {
116
+ writer.uint32(130).string(v);
117
+ }
118
+ if (message._unknownFields !== undefined) {
119
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
120
+ const tag = parseInt(key, 10);
121
+ for (const value of values) {
122
+ writer.uint32(tag).raw(value);
123
+ }
124
+ }
125
+ }
126
+ return writer;
127
+ },
128
+ decode(input, length) {
129
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
130
+ const end = length === undefined ? reader.len : reader.pos + length;
131
+ const message = createBaseUserPublicProfile();
132
+ while (reader.pos < end) {
133
+ const tag = reader.uint32();
134
+ switch (tag >>> 3) {
135
+ case 1: {
136
+ if (tag !== 10) {
137
+ break;
138
+ }
139
+ message.user_id = reader.string();
140
+ continue;
141
+ }
142
+ case 2: {
143
+ if (tag !== 18) {
144
+ break;
145
+ }
146
+ message.display_name = reader.string();
147
+ continue;
148
+ }
149
+ case 3: {
150
+ if (tag !== 24) {
151
+ break;
152
+ }
153
+ message.discriminator = reader.int32();
154
+ continue;
155
+ }
156
+ case 4: {
157
+ if (tag !== 34) {
158
+ break;
159
+ }
160
+ message.avatar_url = reader.string();
161
+ continue;
162
+ }
163
+ case 5: {
164
+ if (tag !== 42) {
165
+ break;
166
+ }
167
+ message.bio = reader.string();
168
+ continue;
169
+ }
170
+ case 6: {
171
+ if (tag !== 48) {
172
+ break;
173
+ }
174
+ message.joined_at = reader.int64().toString();
175
+ continue;
176
+ }
177
+ case 7: {
178
+ if (tag !== 56) {
179
+ break;
180
+ }
181
+ message.scenarios_published = reader.int64().toString();
182
+ continue;
183
+ }
184
+ case 8: {
185
+ if (tag !== 64) {
186
+ break;
187
+ }
188
+ message.total_plays = reader.int64().toString();
189
+ continue;
190
+ }
191
+ case 9: {
192
+ if (tag !== 74) {
193
+ break;
194
+ }
195
+ message.title = reader.string();
196
+ continue;
197
+ }
198
+ case 10: {
199
+ if (tag !== 82) {
200
+ break;
201
+ }
202
+ message.loadout = ProfileLoadout.decode(reader, reader.uint32());
203
+ continue;
204
+ }
205
+ case 11: {
206
+ if (tag !== 90) {
207
+ break;
208
+ }
209
+ message.owned_cosmetics.push(UserCosmeticItem.decode(reader, reader.uint32()));
210
+ continue;
211
+ }
212
+ case 12: {
213
+ if (tag !== 98) {
214
+ break;
215
+ }
216
+ message.status = reader.string();
217
+ continue;
218
+ }
219
+ case 13: {
220
+ if (tag !== 106) {
221
+ break;
222
+ }
223
+ message.showcase.push(ShowcaseItem.decode(reader, reader.uint32()));
224
+ continue;
225
+ }
226
+ case 14: {
227
+ if (tag !== 114) {
228
+ break;
229
+ }
230
+ message.owned_badges.push(UserBadge.decode(reader, reader.uint32()));
231
+ continue;
232
+ }
233
+ case 15: {
234
+ if (tag !== 122) {
235
+ break;
236
+ }
237
+ message.error = ErrorInfo.decode(reader, reader.uint32());
238
+ continue;
239
+ }
240
+ case 16: {
241
+ if (tag !== 130) {
242
+ break;
243
+ }
244
+ message.pinned_badges.push(reader.string());
245
+ continue;
246
+ }
247
+ }
248
+ if ((tag & 7) === 4 || tag === 0) {
249
+ break;
250
+ }
251
+ const buf = reader.skip(tag & 7);
252
+ const list = message._unknownFields[tag];
253
+ if (list === undefined) {
254
+ message._unknownFields[tag] = [buf];
255
+ }
256
+ else {
257
+ list.push(buf);
258
+ }
259
+ }
260
+ return message;
261
+ },
262
+ fromJSON(object) {
263
+ return {
264
+ user_id: isSet(object.userId)
265
+ ? globalThis.String(object.userId)
266
+ : isSet(object.user_id)
267
+ ? globalThis.String(object.user_id)
268
+ : "",
269
+ display_name: isSet(object.displayName)
270
+ ? globalThis.String(object.displayName)
271
+ : isSet(object.display_name)
272
+ ? globalThis.String(object.display_name)
273
+ : "",
274
+ discriminator: isSet(object.discriminator) ? globalThis.Number(object.discriminator) : 0,
275
+ avatar_url: isSet(object.avatarUrl)
276
+ ? globalThis.String(object.avatarUrl)
277
+ : isSet(object.avatar_url)
278
+ ? globalThis.String(object.avatar_url)
279
+ : undefined,
280
+ bio: isSet(object.bio) ? globalThis.String(object.bio) : undefined,
281
+ joined_at: isSet(object.joinedAt)
282
+ ? globalThis.String(object.joinedAt)
283
+ : isSet(object.joined_at)
284
+ ? globalThis.String(object.joined_at)
285
+ : "0",
286
+ scenarios_published: isSet(object.scenariosPublished)
287
+ ? globalThis.String(object.scenariosPublished)
288
+ : isSet(object.scenarios_published)
289
+ ? globalThis.String(object.scenarios_published)
290
+ : "0",
291
+ total_plays: isSet(object.totalPlays)
292
+ ? globalThis.String(object.totalPlays)
293
+ : isSet(object.total_plays)
294
+ ? globalThis.String(object.total_plays)
295
+ : "0",
296
+ title: isSet(object.title) ? globalThis.String(object.title) : undefined,
297
+ loadout: isSet(object.loadout) ? ProfileLoadout.fromJSON(object.loadout) : undefined,
298
+ owned_cosmetics: globalThis.Array.isArray(object?.ownedCosmetics)
299
+ ? object.ownedCosmetics.map((e) => UserCosmeticItem.fromJSON(e))
300
+ : globalThis.Array.isArray(object?.owned_cosmetics)
301
+ ? object.owned_cosmetics.map((e) => UserCosmeticItem.fromJSON(e))
302
+ : [],
303
+ status: isSet(object.status) ? globalThis.String(object.status) : undefined,
304
+ showcase: globalThis.Array.isArray(object?.showcase)
305
+ ? object.showcase.map((e) => ShowcaseItem.fromJSON(e))
306
+ : [],
307
+ owned_badges: globalThis.Array.isArray(object?.ownedBadges)
308
+ ? object.ownedBadges.map((e) => UserBadge.fromJSON(e))
309
+ : globalThis.Array.isArray(object?.owned_badges)
310
+ ? object.owned_badges.map((e) => UserBadge.fromJSON(e))
311
+ : [],
312
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
313
+ pinned_badges: globalThis.Array.isArray(object?.pinnedBadges)
314
+ ? object.pinnedBadges.map((e) => globalThis.String(e))
315
+ : globalThis.Array.isArray(object?.pinned_badges)
316
+ ? object.pinned_badges.map((e) => globalThis.String(e))
317
+ : [],
318
+ };
319
+ },
320
+ toJSON(message) {
321
+ const obj = {};
322
+ if (message.user_id !== "") {
323
+ obj.userId = message.user_id;
324
+ }
325
+ if (message.display_name !== "") {
326
+ obj.displayName = message.display_name;
327
+ }
328
+ if (message.discriminator !== 0) {
329
+ obj.discriminator = Math.round(message.discriminator);
330
+ }
331
+ if (message.avatar_url !== undefined) {
332
+ obj.avatarUrl = message.avatar_url;
333
+ }
334
+ if (message.bio !== undefined) {
335
+ obj.bio = message.bio;
336
+ }
337
+ if (message.joined_at !== "0") {
338
+ obj.joinedAt = message.joined_at;
339
+ }
340
+ if (message.scenarios_published !== "0") {
341
+ obj.scenariosPublished = message.scenarios_published;
342
+ }
343
+ if (message.total_plays !== "0") {
344
+ obj.totalPlays = message.total_plays;
345
+ }
346
+ if (message.title !== undefined) {
347
+ obj.title = message.title;
348
+ }
349
+ if (message.loadout !== undefined) {
350
+ obj.loadout = ProfileLoadout.toJSON(message.loadout);
351
+ }
352
+ if (message.owned_cosmetics?.length) {
353
+ obj.ownedCosmetics = message.owned_cosmetics.map((e) => UserCosmeticItem.toJSON(e));
354
+ }
355
+ if (message.status !== undefined) {
356
+ obj.status = message.status;
357
+ }
358
+ if (message.showcase?.length) {
359
+ obj.showcase = message.showcase.map((e) => ShowcaseItem.toJSON(e));
360
+ }
361
+ if (message.owned_badges?.length) {
362
+ obj.ownedBadges = message.owned_badges.map((e) => UserBadge.toJSON(e));
363
+ }
364
+ if (message.error !== undefined) {
365
+ obj.error = ErrorInfo.toJSON(message.error);
366
+ }
367
+ if (message.pinned_badges?.length) {
368
+ obj.pinnedBadges = message.pinned_badges;
369
+ }
370
+ return obj;
371
+ },
372
+ create(base) {
373
+ return UserPublicProfile.fromPartial(base ?? {});
374
+ },
375
+ fromPartial(object) {
376
+ const message = createBaseUserPublicProfile();
377
+ message.user_id = object.user_id ?? "";
378
+ message.display_name = object.display_name ?? "";
379
+ message.discriminator = object.discriminator ?? 0;
380
+ message.avatar_url = object.avatar_url ?? undefined;
381
+ message.bio = object.bio ?? undefined;
382
+ message.joined_at = object.joined_at ?? "0";
383
+ message.scenarios_published = object.scenarios_published ?? "0";
384
+ message.total_plays = object.total_plays ?? "0";
385
+ message.title = object.title ?? undefined;
386
+ message.loadout = (object.loadout !== undefined && object.loadout !== null)
387
+ ? ProfileLoadout.fromPartial(object.loadout)
388
+ : undefined;
389
+ message.owned_cosmetics = object.owned_cosmetics?.map((e) => UserCosmeticItem.fromPartial(e)) || [];
390
+ message.status = object.status ?? undefined;
391
+ message.showcase = object.showcase?.map((e) => ShowcaseItem.fromPartial(e)) || [];
392
+ message.owned_badges = object.owned_badges?.map((e) => UserBadge.fromPartial(e)) || [];
393
+ message.error = (object.error !== undefined && object.error !== null)
394
+ ? ErrorInfo.fromPartial(object.error)
395
+ : undefined;
396
+ message.pinned_badges = object.pinned_badges?.map((e) => e) || [];
397
+ return message;
398
+ },
399
+ };
400
+ function createBaseShowcaseItem() {
401
+ return {
402
+ kind: "",
403
+ ref_id: "",
404
+ scenario_id: "",
405
+ sort_index: 0,
406
+ instance_id: "",
407
+ config_json: "",
408
+ contract_version: 0,
409
+ render_mode: "",
410
+ _unknownFields: {},
411
+ };
412
+ }
413
+ export const ShowcaseItem = {
414
+ encode(message, writer = new BinaryWriter()) {
415
+ if (message.kind !== "") {
416
+ writer.uint32(10).string(message.kind);
417
+ }
418
+ if (message.ref_id !== "") {
419
+ writer.uint32(18).string(message.ref_id);
420
+ }
421
+ if (message.scenario_id !== "") {
422
+ writer.uint32(26).string(message.scenario_id);
423
+ }
424
+ if (message.sort_index !== 0) {
425
+ writer.uint32(32).int32(message.sort_index);
426
+ }
427
+ if (message.instance_id !== "") {
428
+ writer.uint32(42).string(message.instance_id);
429
+ }
430
+ if (message.config_json !== "") {
431
+ writer.uint32(50).string(message.config_json);
432
+ }
433
+ if (message.contract_version !== 0) {
434
+ writer.uint32(56).uint32(message.contract_version);
435
+ }
436
+ if (message.render_mode !== "") {
437
+ writer.uint32(66).string(message.render_mode);
438
+ }
439
+ if (message._unknownFields !== undefined) {
440
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
441
+ const tag = parseInt(key, 10);
442
+ for (const value of values) {
443
+ writer.uint32(tag).raw(value);
444
+ }
445
+ }
446
+ }
447
+ return writer;
448
+ },
449
+ decode(input, length) {
450
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
451
+ const end = length === undefined ? reader.len : reader.pos + length;
452
+ const message = createBaseShowcaseItem();
453
+ while (reader.pos < end) {
454
+ const tag = reader.uint32();
455
+ switch (tag >>> 3) {
456
+ case 1: {
457
+ if (tag !== 10) {
458
+ break;
459
+ }
460
+ message.kind = reader.string();
461
+ continue;
462
+ }
463
+ case 2: {
464
+ if (tag !== 18) {
465
+ break;
466
+ }
467
+ message.ref_id = reader.string();
468
+ continue;
469
+ }
470
+ case 3: {
471
+ if (tag !== 26) {
472
+ break;
473
+ }
474
+ message.scenario_id = reader.string();
475
+ continue;
476
+ }
477
+ case 4: {
478
+ if (tag !== 32) {
479
+ break;
480
+ }
481
+ message.sort_index = reader.int32();
482
+ continue;
483
+ }
484
+ case 5: {
485
+ if (tag !== 42) {
486
+ break;
487
+ }
488
+ message.instance_id = reader.string();
489
+ continue;
490
+ }
491
+ case 6: {
492
+ if (tag !== 50) {
493
+ break;
494
+ }
495
+ message.config_json = reader.string();
496
+ continue;
497
+ }
498
+ case 7: {
499
+ if (tag !== 56) {
500
+ break;
501
+ }
502
+ message.contract_version = reader.uint32();
503
+ continue;
504
+ }
505
+ case 8: {
506
+ if (tag !== 66) {
507
+ break;
508
+ }
509
+ message.render_mode = reader.string();
510
+ continue;
511
+ }
512
+ }
513
+ if ((tag & 7) === 4 || tag === 0) {
514
+ break;
515
+ }
516
+ const buf = reader.skip(tag & 7);
517
+ const list = message._unknownFields[tag];
518
+ if (list === undefined) {
519
+ message._unknownFields[tag] = [buf];
520
+ }
521
+ else {
522
+ list.push(buf);
523
+ }
524
+ }
525
+ return message;
526
+ },
527
+ fromJSON(object) {
528
+ return {
529
+ kind: isSet(object.kind) ? globalThis.String(object.kind) : "",
530
+ ref_id: isSet(object.refId)
531
+ ? globalThis.String(object.refId)
532
+ : isSet(object.ref_id)
533
+ ? globalThis.String(object.ref_id)
534
+ : "",
535
+ scenario_id: isSet(object.scenarioId)
536
+ ? globalThis.String(object.scenarioId)
537
+ : isSet(object.scenario_id)
538
+ ? globalThis.String(object.scenario_id)
539
+ : "",
540
+ sort_index: isSet(object.sortIndex)
541
+ ? globalThis.Number(object.sortIndex)
542
+ : isSet(object.sort_index)
543
+ ? globalThis.Number(object.sort_index)
544
+ : 0,
545
+ instance_id: isSet(object.instanceId)
546
+ ? globalThis.String(object.instanceId)
547
+ : isSet(object.instance_id)
548
+ ? globalThis.String(object.instance_id)
549
+ : "",
550
+ config_json: isSet(object.configJson)
551
+ ? globalThis.String(object.configJson)
552
+ : isSet(object.config_json)
553
+ ? globalThis.String(object.config_json)
554
+ : "",
555
+ contract_version: isSet(object.contractVersion)
556
+ ? globalThis.Number(object.contractVersion)
557
+ : isSet(object.contract_version)
558
+ ? globalThis.Number(object.contract_version)
559
+ : 0,
560
+ render_mode: isSet(object.renderMode)
561
+ ? globalThis.String(object.renderMode)
562
+ : isSet(object.render_mode)
563
+ ? globalThis.String(object.render_mode)
564
+ : "",
565
+ };
566
+ },
567
+ toJSON(message) {
568
+ const obj = {};
569
+ if (message.kind !== "") {
570
+ obj.kind = message.kind;
571
+ }
572
+ if (message.ref_id !== "") {
573
+ obj.refId = message.ref_id;
574
+ }
575
+ if (message.scenario_id !== "") {
576
+ obj.scenarioId = message.scenario_id;
577
+ }
578
+ if (message.sort_index !== 0) {
579
+ obj.sortIndex = Math.round(message.sort_index);
580
+ }
581
+ if (message.instance_id !== "") {
582
+ obj.instanceId = message.instance_id;
583
+ }
584
+ if (message.config_json !== "") {
585
+ obj.configJson = message.config_json;
586
+ }
587
+ if (message.contract_version !== 0) {
588
+ obj.contractVersion = Math.round(message.contract_version);
589
+ }
590
+ if (message.render_mode !== "") {
591
+ obj.renderMode = message.render_mode;
592
+ }
593
+ return obj;
594
+ },
595
+ create(base) {
596
+ return ShowcaseItem.fromPartial(base ?? {});
597
+ },
598
+ fromPartial(object) {
599
+ const message = createBaseShowcaseItem();
600
+ message.kind = object.kind ?? "";
601
+ message.ref_id = object.ref_id ?? "";
602
+ message.scenario_id = object.scenario_id ?? "";
603
+ message.sort_index = object.sort_index ?? 0;
604
+ message.instance_id = object.instance_id ?? "";
605
+ message.config_json = object.config_json ?? "";
606
+ message.contract_version = object.contract_version ?? 0;
607
+ message.render_mode = object.render_mode ?? "";
608
+ return message;
609
+ },
610
+ };
611
+ function createBaseBadge() {
612
+ return { id: "", name: "", icon: "", rarity: "", description: "", enabled: false, _unknownFields: {} };
613
+ }
614
+ export const Badge = {
615
+ encode(message, writer = new BinaryWriter()) {
616
+ if (message.id !== "") {
617
+ writer.uint32(10).string(message.id);
618
+ }
619
+ if (message.name !== "") {
620
+ writer.uint32(18).string(message.name);
621
+ }
622
+ if (message.icon !== "") {
623
+ writer.uint32(26).string(message.icon);
624
+ }
625
+ if (message.rarity !== "") {
626
+ writer.uint32(34).string(message.rarity);
627
+ }
628
+ if (message.description !== "") {
629
+ writer.uint32(42).string(message.description);
630
+ }
631
+ if (message.enabled !== false) {
632
+ writer.uint32(48).bool(message.enabled);
633
+ }
634
+ if (message._unknownFields !== undefined) {
635
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
636
+ const tag = parseInt(key, 10);
637
+ for (const value of values) {
638
+ writer.uint32(tag).raw(value);
639
+ }
640
+ }
641
+ }
642
+ return writer;
643
+ },
644
+ decode(input, length) {
645
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
646
+ const end = length === undefined ? reader.len : reader.pos + length;
647
+ const message = createBaseBadge();
648
+ while (reader.pos < end) {
649
+ const tag = reader.uint32();
650
+ switch (tag >>> 3) {
651
+ case 1: {
652
+ if (tag !== 10) {
653
+ break;
654
+ }
655
+ message.id = reader.string();
656
+ continue;
657
+ }
658
+ case 2: {
659
+ if (tag !== 18) {
660
+ break;
661
+ }
662
+ message.name = reader.string();
663
+ continue;
664
+ }
665
+ case 3: {
666
+ if (tag !== 26) {
667
+ break;
668
+ }
669
+ message.icon = reader.string();
670
+ continue;
671
+ }
672
+ case 4: {
673
+ if (tag !== 34) {
674
+ break;
675
+ }
676
+ message.rarity = reader.string();
677
+ continue;
678
+ }
679
+ case 5: {
680
+ if (tag !== 42) {
681
+ break;
682
+ }
683
+ message.description = reader.string();
684
+ continue;
685
+ }
686
+ case 6: {
687
+ if (tag !== 48) {
688
+ break;
689
+ }
690
+ message.enabled = reader.bool();
691
+ continue;
692
+ }
693
+ }
694
+ if ((tag & 7) === 4 || tag === 0) {
695
+ break;
696
+ }
697
+ const buf = reader.skip(tag & 7);
698
+ const list = message._unknownFields[tag];
699
+ if (list === undefined) {
700
+ message._unknownFields[tag] = [buf];
701
+ }
702
+ else {
703
+ list.push(buf);
704
+ }
705
+ }
706
+ return message;
707
+ },
708
+ fromJSON(object) {
709
+ return {
710
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
711
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
712
+ icon: isSet(object.icon) ? globalThis.String(object.icon) : "",
713
+ rarity: isSet(object.rarity) ? globalThis.String(object.rarity) : "",
714
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
715
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
716
+ };
717
+ },
718
+ toJSON(message) {
719
+ const obj = {};
720
+ if (message.id !== "") {
721
+ obj.id = message.id;
722
+ }
723
+ if (message.name !== "") {
724
+ obj.name = message.name;
725
+ }
726
+ if (message.icon !== "") {
727
+ obj.icon = message.icon;
728
+ }
729
+ if (message.rarity !== "") {
730
+ obj.rarity = message.rarity;
731
+ }
732
+ if (message.description !== "") {
733
+ obj.description = message.description;
734
+ }
735
+ if (message.enabled !== false) {
736
+ obj.enabled = message.enabled;
737
+ }
738
+ return obj;
739
+ },
740
+ create(base) {
741
+ return Badge.fromPartial(base ?? {});
742
+ },
743
+ fromPartial(object) {
744
+ const message = createBaseBadge();
745
+ message.id = object.id ?? "";
746
+ message.name = object.name ?? "";
747
+ message.icon = object.icon ?? "";
748
+ message.rarity = object.rarity ?? "";
749
+ message.description = object.description ?? "";
750
+ message.enabled = object.enabled ?? false;
751
+ return message;
752
+ },
753
+ };
754
+ function createBaseUserBadge() {
755
+ return { badge_id: "", granted_at: "0", _unknownFields: {} };
756
+ }
757
+ export const UserBadge = {
758
+ encode(message, writer = new BinaryWriter()) {
759
+ if (message.badge_id !== "") {
760
+ writer.uint32(10).string(message.badge_id);
761
+ }
762
+ if (message.granted_at !== "0") {
763
+ writer.uint32(16).int64(message.granted_at);
764
+ }
765
+ if (message._unknownFields !== undefined) {
766
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
767
+ const tag = parseInt(key, 10);
768
+ for (const value of values) {
769
+ writer.uint32(tag).raw(value);
770
+ }
771
+ }
772
+ }
773
+ return writer;
774
+ },
775
+ decode(input, length) {
776
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
777
+ const end = length === undefined ? reader.len : reader.pos + length;
778
+ const message = createBaseUserBadge();
779
+ while (reader.pos < end) {
780
+ const tag = reader.uint32();
781
+ switch (tag >>> 3) {
782
+ case 1: {
783
+ if (tag !== 10) {
784
+ break;
785
+ }
786
+ message.badge_id = reader.string();
787
+ continue;
788
+ }
789
+ case 2: {
790
+ if (tag !== 16) {
791
+ break;
792
+ }
793
+ message.granted_at = reader.int64().toString();
794
+ continue;
795
+ }
796
+ }
797
+ if ((tag & 7) === 4 || tag === 0) {
798
+ break;
799
+ }
800
+ const buf = reader.skip(tag & 7);
801
+ const list = message._unknownFields[tag];
802
+ if (list === undefined) {
803
+ message._unknownFields[tag] = [buf];
804
+ }
805
+ else {
806
+ list.push(buf);
807
+ }
808
+ }
809
+ return message;
810
+ },
811
+ fromJSON(object) {
812
+ return {
813
+ badge_id: isSet(object.badgeId)
814
+ ? globalThis.String(object.badgeId)
815
+ : isSet(object.badge_id)
816
+ ? globalThis.String(object.badge_id)
817
+ : "",
818
+ granted_at: isSet(object.grantedAt)
819
+ ? globalThis.String(object.grantedAt)
820
+ : isSet(object.granted_at)
821
+ ? globalThis.String(object.granted_at)
822
+ : "0",
823
+ };
824
+ },
825
+ toJSON(message) {
826
+ const obj = {};
827
+ if (message.badge_id !== "") {
828
+ obj.badgeId = message.badge_id;
829
+ }
830
+ if (message.granted_at !== "0") {
831
+ obj.grantedAt = message.granted_at;
832
+ }
833
+ return obj;
834
+ },
835
+ create(base) {
836
+ return UserBadge.fromPartial(base ?? {});
837
+ },
838
+ fromPartial(object) {
839
+ const message = createBaseUserBadge();
840
+ message.badge_id = object.badge_id ?? "";
841
+ message.granted_at = object.granted_at ?? "0";
842
+ return message;
843
+ },
844
+ };
845
+ function createBaseListBadgesResponse() {
846
+ return { items: [], error: undefined, _unknownFields: {} };
847
+ }
848
+ export const ListBadgesResponse = {
849
+ encode(message, writer = new BinaryWriter()) {
850
+ for (const v of message.items) {
851
+ Badge.encode(v, writer.uint32(10).fork()).join();
852
+ }
853
+ if (message.error !== undefined) {
854
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
855
+ }
856
+ if (message._unknownFields !== undefined) {
857
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
858
+ const tag = parseInt(key, 10);
859
+ for (const value of values) {
860
+ writer.uint32(tag).raw(value);
861
+ }
862
+ }
863
+ }
864
+ return writer;
865
+ },
866
+ decode(input, length) {
867
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
868
+ const end = length === undefined ? reader.len : reader.pos + length;
869
+ const message = createBaseListBadgesResponse();
870
+ while (reader.pos < end) {
871
+ const tag = reader.uint32();
872
+ switch (tag >>> 3) {
873
+ case 1: {
874
+ if (tag !== 10) {
875
+ break;
876
+ }
877
+ message.items.push(Badge.decode(reader, reader.uint32()));
878
+ continue;
879
+ }
880
+ case 15: {
881
+ if (tag !== 122) {
882
+ break;
883
+ }
884
+ message.error = ErrorInfo.decode(reader, reader.uint32());
885
+ continue;
886
+ }
887
+ }
888
+ if ((tag & 7) === 4 || tag === 0) {
889
+ break;
890
+ }
891
+ const buf = reader.skip(tag & 7);
892
+ const list = message._unknownFields[tag];
893
+ if (list === undefined) {
894
+ message._unknownFields[tag] = [buf];
895
+ }
896
+ else {
897
+ list.push(buf);
898
+ }
899
+ }
900
+ return message;
901
+ },
902
+ fromJSON(object) {
903
+ return {
904
+ items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => Badge.fromJSON(e)) : [],
905
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
906
+ };
907
+ },
908
+ toJSON(message) {
909
+ const obj = {};
910
+ if (message.items?.length) {
911
+ obj.items = message.items.map((e) => Badge.toJSON(e));
912
+ }
913
+ if (message.error !== undefined) {
914
+ obj.error = ErrorInfo.toJSON(message.error);
915
+ }
916
+ return obj;
917
+ },
918
+ create(base) {
919
+ return ListBadgesResponse.fromPartial(base ?? {});
920
+ },
921
+ fromPartial(object) {
922
+ const message = createBaseListBadgesResponse();
923
+ message.items = object.items?.map((e) => Badge.fromPartial(e)) || [];
924
+ message.error = (object.error !== undefined && object.error !== null)
925
+ ? ErrorInfo.fromPartial(object.error)
926
+ : undefined;
927
+ return message;
928
+ },
929
+ };
930
+ function createBaseUserBadgesResponse() {
931
+ return { items: [], error: undefined, _unknownFields: {} };
932
+ }
933
+ export const UserBadgesResponse = {
934
+ encode(message, writer = new BinaryWriter()) {
935
+ for (const v of message.items) {
936
+ UserBadge.encode(v, writer.uint32(10).fork()).join();
937
+ }
938
+ if (message.error !== undefined) {
939
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
940
+ }
941
+ if (message._unknownFields !== undefined) {
942
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
943
+ const tag = parseInt(key, 10);
944
+ for (const value of values) {
945
+ writer.uint32(tag).raw(value);
946
+ }
947
+ }
948
+ }
949
+ return writer;
950
+ },
951
+ decode(input, length) {
952
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
953
+ const end = length === undefined ? reader.len : reader.pos + length;
954
+ const message = createBaseUserBadgesResponse();
955
+ while (reader.pos < end) {
956
+ const tag = reader.uint32();
957
+ switch (tag >>> 3) {
958
+ case 1: {
959
+ if (tag !== 10) {
960
+ break;
961
+ }
962
+ message.items.push(UserBadge.decode(reader, reader.uint32()));
963
+ continue;
964
+ }
965
+ case 15: {
966
+ if (tag !== 122) {
967
+ break;
968
+ }
969
+ message.error = ErrorInfo.decode(reader, reader.uint32());
970
+ continue;
971
+ }
972
+ }
973
+ if ((tag & 7) === 4 || tag === 0) {
974
+ break;
975
+ }
976
+ const buf = reader.skip(tag & 7);
977
+ const list = message._unknownFields[tag];
978
+ if (list === undefined) {
979
+ message._unknownFields[tag] = [buf];
980
+ }
981
+ else {
982
+ list.push(buf);
983
+ }
984
+ }
985
+ return message;
986
+ },
987
+ fromJSON(object) {
988
+ return {
989
+ items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => UserBadge.fromJSON(e)) : [],
990
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
991
+ };
992
+ },
993
+ toJSON(message) {
994
+ const obj = {};
995
+ if (message.items?.length) {
996
+ obj.items = message.items.map((e) => UserBadge.toJSON(e));
997
+ }
998
+ if (message.error !== undefined) {
999
+ obj.error = ErrorInfo.toJSON(message.error);
1000
+ }
1001
+ return obj;
1002
+ },
1003
+ create(base) {
1004
+ return UserBadgesResponse.fromPartial(base ?? {});
1005
+ },
1006
+ fromPartial(object) {
1007
+ const message = createBaseUserBadgesResponse();
1008
+ message.items = object.items?.map((e) => UserBadge.fromPartial(e)) || [];
1009
+ message.error = (object.error !== undefined && object.error !== null)
1010
+ ? ErrorInfo.fromPartial(object.error)
1011
+ : undefined;
1012
+ return message;
1013
+ },
1014
+ };
1015
+ function createBasePutPinnedBadgesRequest() {
1016
+ return { badge_ids: [], _unknownFields: {} };
1017
+ }
1018
+ export const PutPinnedBadgesRequest = {
1019
+ encode(message, writer = new BinaryWriter()) {
1020
+ for (const v of message.badge_ids) {
1021
+ writer.uint32(10).string(v);
1022
+ }
1023
+ if (message._unknownFields !== undefined) {
1024
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1025
+ const tag = parseInt(key, 10);
1026
+ for (const value of values) {
1027
+ writer.uint32(tag).raw(value);
1028
+ }
1029
+ }
1030
+ }
1031
+ return writer;
1032
+ },
1033
+ decode(input, length) {
1034
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1035
+ const end = length === undefined ? reader.len : reader.pos + length;
1036
+ const message = createBasePutPinnedBadgesRequest();
1037
+ while (reader.pos < end) {
1038
+ const tag = reader.uint32();
1039
+ switch (tag >>> 3) {
1040
+ case 1: {
1041
+ if (tag !== 10) {
1042
+ break;
1043
+ }
1044
+ message.badge_ids.push(reader.string());
1045
+ continue;
1046
+ }
1047
+ }
1048
+ if ((tag & 7) === 4 || tag === 0) {
1049
+ break;
1050
+ }
1051
+ const buf = reader.skip(tag & 7);
1052
+ const list = message._unknownFields[tag];
1053
+ if (list === undefined) {
1054
+ message._unknownFields[tag] = [buf];
1055
+ }
1056
+ else {
1057
+ list.push(buf);
1058
+ }
1059
+ }
1060
+ return message;
1061
+ },
1062
+ fromJSON(object) {
1063
+ return {
1064
+ badge_ids: globalThis.Array.isArray(object?.badgeIds)
1065
+ ? object.badgeIds.map((e) => globalThis.String(e))
1066
+ : globalThis.Array.isArray(object?.badge_ids)
1067
+ ? object.badge_ids.map((e) => globalThis.String(e))
1068
+ : [],
1069
+ };
1070
+ },
1071
+ toJSON(message) {
1072
+ const obj = {};
1073
+ if (message.badge_ids?.length) {
1074
+ obj.badgeIds = message.badge_ids;
1075
+ }
1076
+ return obj;
1077
+ },
1078
+ create(base) {
1079
+ return PutPinnedBadgesRequest.fromPartial(base ?? {});
1080
+ },
1081
+ fromPartial(object) {
1082
+ const message = createBasePutPinnedBadgesRequest();
1083
+ message.badge_ids = object.badge_ids?.map((e) => e) || [];
1084
+ return message;
1085
+ },
1086
+ };
1087
+ function createBasePutPinnedBadgesResponse() {
1088
+ return { ok: false, count: "0", error: undefined, _unknownFields: {} };
1089
+ }
1090
+ export const PutPinnedBadgesResponse = {
1091
+ encode(message, writer = new BinaryWriter()) {
1092
+ if (message.ok !== false) {
1093
+ writer.uint32(8).bool(message.ok);
1094
+ }
1095
+ if (message.count !== "0") {
1096
+ writer.uint32(16).int64(message.count);
1097
+ }
1098
+ if (message.error !== undefined) {
1099
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
1100
+ }
1101
+ if (message._unknownFields !== undefined) {
1102
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1103
+ const tag = parseInt(key, 10);
1104
+ for (const value of values) {
1105
+ writer.uint32(tag).raw(value);
1106
+ }
1107
+ }
1108
+ }
1109
+ return writer;
1110
+ },
1111
+ decode(input, length) {
1112
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1113
+ const end = length === undefined ? reader.len : reader.pos + length;
1114
+ const message = createBasePutPinnedBadgesResponse();
1115
+ while (reader.pos < end) {
1116
+ const tag = reader.uint32();
1117
+ switch (tag >>> 3) {
1118
+ case 1: {
1119
+ if (tag !== 8) {
1120
+ break;
1121
+ }
1122
+ message.ok = reader.bool();
1123
+ continue;
1124
+ }
1125
+ case 2: {
1126
+ if (tag !== 16) {
1127
+ break;
1128
+ }
1129
+ message.count = reader.int64().toString();
1130
+ continue;
1131
+ }
1132
+ case 15: {
1133
+ if (tag !== 122) {
1134
+ break;
1135
+ }
1136
+ message.error = ErrorInfo.decode(reader, reader.uint32());
1137
+ continue;
1138
+ }
1139
+ }
1140
+ if ((tag & 7) === 4 || tag === 0) {
1141
+ break;
1142
+ }
1143
+ const buf = reader.skip(tag & 7);
1144
+ const list = message._unknownFields[tag];
1145
+ if (list === undefined) {
1146
+ message._unknownFields[tag] = [buf];
1147
+ }
1148
+ else {
1149
+ list.push(buf);
1150
+ }
1151
+ }
1152
+ return message;
1153
+ },
1154
+ fromJSON(object) {
1155
+ return {
1156
+ ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false,
1157
+ count: isSet(object.count) ? globalThis.String(object.count) : "0",
1158
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
1159
+ };
1160
+ },
1161
+ toJSON(message) {
1162
+ const obj = {};
1163
+ if (message.ok !== false) {
1164
+ obj.ok = message.ok;
1165
+ }
1166
+ if (message.count !== "0") {
1167
+ obj.count = message.count;
1168
+ }
1169
+ if (message.error !== undefined) {
1170
+ obj.error = ErrorInfo.toJSON(message.error);
1171
+ }
1172
+ return obj;
1173
+ },
1174
+ create(base) {
1175
+ return PutPinnedBadgesResponse.fromPartial(base ?? {});
1176
+ },
1177
+ fromPartial(object) {
1178
+ const message = createBasePutPinnedBadgesResponse();
1179
+ message.ok = object.ok ?? false;
1180
+ message.count = object.count ?? "0";
1181
+ message.error = (object.error !== undefined && object.error !== null)
1182
+ ? ErrorInfo.fromPartial(object.error)
1183
+ : undefined;
1184
+ return message;
1185
+ },
1186
+ };
1187
+ function createBaseCosmetic() {
1188
+ return {
1189
+ id: "",
1190
+ slot: "",
1191
+ name: "",
1192
+ icon: "",
1193
+ price_shark: "0",
1194
+ rarity: "",
1195
+ config_json: "",
1196
+ enabled: false,
1197
+ unlock_criterion_json: undefined,
1198
+ _unknownFields: {},
1199
+ };
1200
+ }
1201
+ export const Cosmetic = {
1202
+ encode(message, writer = new BinaryWriter()) {
1203
+ if (message.id !== "") {
1204
+ writer.uint32(10).string(message.id);
1205
+ }
1206
+ if (message.slot !== "") {
1207
+ writer.uint32(18).string(message.slot);
1208
+ }
1209
+ if (message.name !== "") {
1210
+ writer.uint32(26).string(message.name);
1211
+ }
1212
+ if (message.icon !== "") {
1213
+ writer.uint32(34).string(message.icon);
1214
+ }
1215
+ if (message.price_shark !== "0") {
1216
+ writer.uint32(40).int64(message.price_shark);
1217
+ }
1218
+ if (message.rarity !== "") {
1219
+ writer.uint32(50).string(message.rarity);
1220
+ }
1221
+ if (message.config_json !== "") {
1222
+ writer.uint32(58).string(message.config_json);
1223
+ }
1224
+ if (message.enabled !== false) {
1225
+ writer.uint32(64).bool(message.enabled);
1226
+ }
1227
+ if (message.unlock_criterion_json !== undefined) {
1228
+ writer.uint32(74).string(message.unlock_criterion_json);
1229
+ }
1230
+ if (message._unknownFields !== undefined) {
1231
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1232
+ const tag = parseInt(key, 10);
1233
+ for (const value of values) {
1234
+ writer.uint32(tag).raw(value);
1235
+ }
1236
+ }
1237
+ }
1238
+ return writer;
1239
+ },
1240
+ decode(input, length) {
1241
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1242
+ const end = length === undefined ? reader.len : reader.pos + length;
1243
+ const message = createBaseCosmetic();
1244
+ while (reader.pos < end) {
1245
+ const tag = reader.uint32();
1246
+ switch (tag >>> 3) {
1247
+ case 1: {
1248
+ if (tag !== 10) {
1249
+ break;
1250
+ }
1251
+ message.id = reader.string();
1252
+ continue;
1253
+ }
1254
+ case 2: {
1255
+ if (tag !== 18) {
1256
+ break;
1257
+ }
1258
+ message.slot = reader.string();
1259
+ continue;
1260
+ }
1261
+ case 3: {
1262
+ if (tag !== 26) {
1263
+ break;
1264
+ }
1265
+ message.name = reader.string();
1266
+ continue;
1267
+ }
1268
+ case 4: {
1269
+ if (tag !== 34) {
1270
+ break;
1271
+ }
1272
+ message.icon = reader.string();
1273
+ continue;
1274
+ }
1275
+ case 5: {
1276
+ if (tag !== 40) {
1277
+ break;
1278
+ }
1279
+ message.price_shark = reader.int64().toString();
1280
+ continue;
1281
+ }
1282
+ case 6: {
1283
+ if (tag !== 50) {
1284
+ break;
1285
+ }
1286
+ message.rarity = reader.string();
1287
+ continue;
1288
+ }
1289
+ case 7: {
1290
+ if (tag !== 58) {
1291
+ break;
1292
+ }
1293
+ message.config_json = reader.string();
1294
+ continue;
1295
+ }
1296
+ case 8: {
1297
+ if (tag !== 64) {
1298
+ break;
1299
+ }
1300
+ message.enabled = reader.bool();
1301
+ continue;
1302
+ }
1303
+ case 9: {
1304
+ if (tag !== 74) {
1305
+ break;
1306
+ }
1307
+ message.unlock_criterion_json = reader.string();
1308
+ continue;
1309
+ }
1310
+ }
1311
+ if ((tag & 7) === 4 || tag === 0) {
1312
+ break;
1313
+ }
1314
+ const buf = reader.skip(tag & 7);
1315
+ const list = message._unknownFields[tag];
1316
+ if (list === undefined) {
1317
+ message._unknownFields[tag] = [buf];
1318
+ }
1319
+ else {
1320
+ list.push(buf);
1321
+ }
1322
+ }
1323
+ return message;
1324
+ },
1325
+ fromJSON(object) {
1326
+ return {
1327
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1328
+ slot: isSet(object.slot) ? globalThis.String(object.slot) : "",
1329
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1330
+ icon: isSet(object.icon) ? globalThis.String(object.icon) : "",
1331
+ price_shark: isSet(object.priceShark)
1332
+ ? globalThis.String(object.priceShark)
1333
+ : isSet(object.price_shark)
1334
+ ? globalThis.String(object.price_shark)
1335
+ : "0",
1336
+ rarity: isSet(object.rarity) ? globalThis.String(object.rarity) : "",
1337
+ config_json: isSet(object.configJson)
1338
+ ? globalThis.String(object.configJson)
1339
+ : isSet(object.config_json)
1340
+ ? globalThis.String(object.config_json)
1341
+ : "",
1342
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
1343
+ unlock_criterion_json: isSet(object.unlockCriterionJson)
1344
+ ? globalThis.String(object.unlockCriterionJson)
1345
+ : isSet(object.unlock_criterion_json)
1346
+ ? globalThis.String(object.unlock_criterion_json)
1347
+ : undefined,
1348
+ };
1349
+ },
1350
+ toJSON(message) {
1351
+ const obj = {};
1352
+ if (message.id !== "") {
1353
+ obj.id = message.id;
1354
+ }
1355
+ if (message.slot !== "") {
1356
+ obj.slot = message.slot;
1357
+ }
1358
+ if (message.name !== "") {
1359
+ obj.name = message.name;
1360
+ }
1361
+ if (message.icon !== "") {
1362
+ obj.icon = message.icon;
1363
+ }
1364
+ if (message.price_shark !== "0") {
1365
+ obj.priceShark = message.price_shark;
1366
+ }
1367
+ if (message.rarity !== "") {
1368
+ obj.rarity = message.rarity;
1369
+ }
1370
+ if (message.config_json !== "") {
1371
+ obj.configJson = message.config_json;
1372
+ }
1373
+ if (message.enabled !== false) {
1374
+ obj.enabled = message.enabled;
1375
+ }
1376
+ if (message.unlock_criterion_json !== undefined) {
1377
+ obj.unlockCriterionJson = message.unlock_criterion_json;
1378
+ }
1379
+ return obj;
1380
+ },
1381
+ create(base) {
1382
+ return Cosmetic.fromPartial(base ?? {});
1383
+ },
1384
+ fromPartial(object) {
1385
+ const message = createBaseCosmetic();
1386
+ message.id = object.id ?? "";
1387
+ message.slot = object.slot ?? "";
1388
+ message.name = object.name ?? "";
1389
+ message.icon = object.icon ?? "";
1390
+ message.price_shark = object.price_shark ?? "0";
1391
+ message.rarity = object.rarity ?? "";
1392
+ message.config_json = object.config_json ?? "";
1393
+ message.enabled = object.enabled ?? false;
1394
+ message.unlock_criterion_json = object.unlock_criterion_json ?? undefined;
1395
+ return message;
1396
+ },
1397
+ };
1398
+ function createBaseUserCosmeticItem() {
1399
+ return { cosmetic_id: "", acquired_at: "0", _unknownFields: {} };
1400
+ }
1401
+ export const UserCosmeticItem = {
1402
+ encode(message, writer = new BinaryWriter()) {
1403
+ if (message.cosmetic_id !== "") {
1404
+ writer.uint32(10).string(message.cosmetic_id);
1405
+ }
1406
+ if (message.acquired_at !== "0") {
1407
+ writer.uint32(16).int64(message.acquired_at);
1408
+ }
1409
+ if (message._unknownFields !== undefined) {
1410
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1411
+ const tag = parseInt(key, 10);
1412
+ for (const value of values) {
1413
+ writer.uint32(tag).raw(value);
1414
+ }
1415
+ }
1416
+ }
1417
+ return writer;
1418
+ },
1419
+ decode(input, length) {
1420
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1421
+ const end = length === undefined ? reader.len : reader.pos + length;
1422
+ const message = createBaseUserCosmeticItem();
1423
+ while (reader.pos < end) {
1424
+ const tag = reader.uint32();
1425
+ switch (tag >>> 3) {
1426
+ case 1: {
1427
+ if (tag !== 10) {
1428
+ break;
1429
+ }
1430
+ message.cosmetic_id = reader.string();
1431
+ continue;
1432
+ }
1433
+ case 2: {
1434
+ if (tag !== 16) {
1435
+ break;
1436
+ }
1437
+ message.acquired_at = reader.int64().toString();
1438
+ continue;
1439
+ }
1440
+ }
1441
+ if ((tag & 7) === 4 || tag === 0) {
1442
+ break;
1443
+ }
1444
+ const buf = reader.skip(tag & 7);
1445
+ const list = message._unknownFields[tag];
1446
+ if (list === undefined) {
1447
+ message._unknownFields[tag] = [buf];
1448
+ }
1449
+ else {
1450
+ list.push(buf);
1451
+ }
1452
+ }
1453
+ return message;
1454
+ },
1455
+ fromJSON(object) {
1456
+ return {
1457
+ cosmetic_id: isSet(object.cosmeticId)
1458
+ ? globalThis.String(object.cosmeticId)
1459
+ : isSet(object.cosmetic_id)
1460
+ ? globalThis.String(object.cosmetic_id)
1461
+ : "",
1462
+ acquired_at: isSet(object.acquiredAt)
1463
+ ? globalThis.String(object.acquiredAt)
1464
+ : isSet(object.acquired_at)
1465
+ ? globalThis.String(object.acquired_at)
1466
+ : "0",
1467
+ };
1468
+ },
1469
+ toJSON(message) {
1470
+ const obj = {};
1471
+ if (message.cosmetic_id !== "") {
1472
+ obj.cosmeticId = message.cosmetic_id;
1473
+ }
1474
+ if (message.acquired_at !== "0") {
1475
+ obj.acquiredAt = message.acquired_at;
1476
+ }
1477
+ return obj;
1478
+ },
1479
+ create(base) {
1480
+ return UserCosmeticItem.fromPartial(base ?? {});
1481
+ },
1482
+ fromPartial(object) {
1483
+ const message = createBaseUserCosmeticItem();
1484
+ message.cosmetic_id = object.cosmetic_id ?? "";
1485
+ message.acquired_at = object.acquired_at ?? "0";
1486
+ return message;
1487
+ },
1488
+ };
1489
+ function createBaseBackgroundRef() {
1490
+ return { kind: 0, id: "", scenario_id: "", _unknownFields: {} };
1491
+ }
1492
+ export const BackgroundRef = {
1493
+ encode(message, writer = new BinaryWriter()) {
1494
+ if (message.kind !== 0) {
1495
+ writer.uint32(8).int32(message.kind);
1496
+ }
1497
+ if (message.id !== "") {
1498
+ writer.uint32(18).string(message.id);
1499
+ }
1500
+ if (message.scenario_id !== "") {
1501
+ writer.uint32(26).string(message.scenario_id);
1502
+ }
1503
+ if (message._unknownFields !== undefined) {
1504
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1505
+ const tag = parseInt(key, 10);
1506
+ for (const value of values) {
1507
+ writer.uint32(tag).raw(value);
1508
+ }
1509
+ }
1510
+ }
1511
+ return writer;
1512
+ },
1513
+ decode(input, length) {
1514
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1515
+ const end = length === undefined ? reader.len : reader.pos + length;
1516
+ const message = createBaseBackgroundRef();
1517
+ while (reader.pos < end) {
1518
+ const tag = reader.uint32();
1519
+ switch (tag >>> 3) {
1520
+ case 1: {
1521
+ if (tag !== 8) {
1522
+ break;
1523
+ }
1524
+ message.kind = reader.int32();
1525
+ continue;
1526
+ }
1527
+ case 2: {
1528
+ if (tag !== 18) {
1529
+ break;
1530
+ }
1531
+ message.id = reader.string();
1532
+ continue;
1533
+ }
1534
+ case 3: {
1535
+ if (tag !== 26) {
1536
+ break;
1537
+ }
1538
+ message.scenario_id = reader.string();
1539
+ continue;
1540
+ }
1541
+ }
1542
+ if ((tag & 7) === 4 || tag === 0) {
1543
+ break;
1544
+ }
1545
+ const buf = reader.skip(tag & 7);
1546
+ const list = message._unknownFields[tag];
1547
+ if (list === undefined) {
1548
+ message._unknownFields[tag] = [buf];
1549
+ }
1550
+ else {
1551
+ list.push(buf);
1552
+ }
1553
+ }
1554
+ return message;
1555
+ },
1556
+ fromJSON(object) {
1557
+ return {
1558
+ kind: isSet(object.kind) ? backgroundKindFromJSON(object.kind) : 0,
1559
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1560
+ scenario_id: isSet(object.scenarioId)
1561
+ ? globalThis.String(object.scenarioId)
1562
+ : isSet(object.scenario_id)
1563
+ ? globalThis.String(object.scenario_id)
1564
+ : "",
1565
+ };
1566
+ },
1567
+ toJSON(message) {
1568
+ const obj = {};
1569
+ if (message.kind !== 0) {
1570
+ obj.kind = backgroundKindToJSON(message.kind);
1571
+ }
1572
+ if (message.id !== "") {
1573
+ obj.id = message.id;
1574
+ }
1575
+ if (message.scenario_id !== "") {
1576
+ obj.scenarioId = message.scenario_id;
1577
+ }
1578
+ return obj;
1579
+ },
1580
+ create(base) {
1581
+ return BackgroundRef.fromPartial(base ?? {});
1582
+ },
1583
+ fromPartial(object) {
1584
+ const message = createBaseBackgroundRef();
1585
+ message.kind = object.kind ?? 0;
1586
+ message.id = object.id ?? "";
1587
+ message.scenario_id = object.scenario_id ?? "";
1588
+ return message;
1589
+ },
1590
+ };
1591
+ function createBaseBackgroundLoadout() {
1592
+ return { sfw: undefined, nsfw: undefined, _unknownFields: {} };
1593
+ }
1594
+ export const BackgroundLoadout = {
1595
+ encode(message, writer = new BinaryWriter()) {
1596
+ if (message.sfw !== undefined) {
1597
+ BackgroundRef.encode(message.sfw, writer.uint32(10).fork()).join();
1598
+ }
1599
+ if (message.nsfw !== undefined) {
1600
+ BackgroundRef.encode(message.nsfw, writer.uint32(18).fork()).join();
1601
+ }
1602
+ if (message._unknownFields !== undefined) {
1603
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1604
+ const tag = parseInt(key, 10);
1605
+ for (const value of values) {
1606
+ writer.uint32(tag).raw(value);
1607
+ }
1608
+ }
1609
+ }
1610
+ return writer;
1611
+ },
1612
+ decode(input, length) {
1613
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1614
+ const end = length === undefined ? reader.len : reader.pos + length;
1615
+ const message = createBaseBackgroundLoadout();
1616
+ while (reader.pos < end) {
1617
+ const tag = reader.uint32();
1618
+ switch (tag >>> 3) {
1619
+ case 1: {
1620
+ if (tag !== 10) {
1621
+ break;
1622
+ }
1623
+ message.sfw = BackgroundRef.decode(reader, reader.uint32());
1624
+ continue;
1625
+ }
1626
+ case 2: {
1627
+ if (tag !== 18) {
1628
+ break;
1629
+ }
1630
+ message.nsfw = BackgroundRef.decode(reader, reader.uint32());
1631
+ continue;
1632
+ }
1633
+ }
1634
+ if ((tag & 7) === 4 || tag === 0) {
1635
+ break;
1636
+ }
1637
+ const buf = reader.skip(tag & 7);
1638
+ const list = message._unknownFields[tag];
1639
+ if (list === undefined) {
1640
+ message._unknownFields[tag] = [buf];
1641
+ }
1642
+ else {
1643
+ list.push(buf);
1644
+ }
1645
+ }
1646
+ return message;
1647
+ },
1648
+ fromJSON(object) {
1649
+ return {
1650
+ sfw: isSet(object.sfw) ? BackgroundRef.fromJSON(object.sfw) : undefined,
1651
+ nsfw: isSet(object.nsfw) ? BackgroundRef.fromJSON(object.nsfw) : undefined,
1652
+ };
1653
+ },
1654
+ toJSON(message) {
1655
+ const obj = {};
1656
+ if (message.sfw !== undefined) {
1657
+ obj.sfw = BackgroundRef.toJSON(message.sfw);
1658
+ }
1659
+ if (message.nsfw !== undefined) {
1660
+ obj.nsfw = BackgroundRef.toJSON(message.nsfw);
1661
+ }
1662
+ return obj;
1663
+ },
1664
+ create(base) {
1665
+ return BackgroundLoadout.fromPartial(base ?? {});
1666
+ },
1667
+ fromPartial(object) {
1668
+ const message = createBaseBackgroundLoadout();
1669
+ message.sfw = (object.sfw !== undefined && object.sfw !== null) ? BackgroundRef.fromPartial(object.sfw) : undefined;
1670
+ message.nsfw = (object.nsfw !== undefined && object.nsfw !== null)
1671
+ ? BackgroundRef.fromPartial(object.nsfw)
1672
+ : undefined;
1673
+ return message;
1674
+ },
1675
+ };
1676
+ function createBaseProfileLoadout() {
1677
+ return {
1678
+ frame_id: "",
1679
+ title_id: "",
1680
+ status_id: "",
1681
+ palette_id: "",
1682
+ font_id: "",
1683
+ iconset_id: "",
1684
+ layout_id: "",
1685
+ border_id: "",
1686
+ background: undefined,
1687
+ banner_id: "",
1688
+ effect_id: "",
1689
+ showcase_id: "",
1690
+ badges_id: "",
1691
+ desktop_theme_id: "",
1692
+ _unknownFields: {},
1693
+ };
1694
+ }
1695
+ export const ProfileLoadout = {
1696
+ encode(message, writer = new BinaryWriter()) {
1697
+ if (message.frame_id !== "") {
1698
+ writer.uint32(10).string(message.frame_id);
1699
+ }
1700
+ if (message.title_id !== "") {
1701
+ writer.uint32(18).string(message.title_id);
1702
+ }
1703
+ if (message.status_id !== "") {
1704
+ writer.uint32(26).string(message.status_id);
1705
+ }
1706
+ if (message.palette_id !== "") {
1707
+ writer.uint32(34).string(message.palette_id);
1708
+ }
1709
+ if (message.font_id !== "") {
1710
+ writer.uint32(42).string(message.font_id);
1711
+ }
1712
+ if (message.iconset_id !== "") {
1713
+ writer.uint32(50).string(message.iconset_id);
1714
+ }
1715
+ if (message.layout_id !== "") {
1716
+ writer.uint32(58).string(message.layout_id);
1717
+ }
1718
+ if (message.border_id !== "") {
1719
+ writer.uint32(66).string(message.border_id);
1720
+ }
1721
+ if (message.background !== undefined) {
1722
+ BackgroundLoadout.encode(message.background, writer.uint32(74).fork()).join();
1723
+ }
1724
+ if (message.banner_id !== "") {
1725
+ writer.uint32(82).string(message.banner_id);
1726
+ }
1727
+ if (message.effect_id !== "") {
1728
+ writer.uint32(90).string(message.effect_id);
1729
+ }
1730
+ if (message.showcase_id !== "") {
1731
+ writer.uint32(98).string(message.showcase_id);
1732
+ }
1733
+ if (message.badges_id !== "") {
1734
+ writer.uint32(106).string(message.badges_id);
1735
+ }
1736
+ if (message.desktop_theme_id !== "") {
1737
+ writer.uint32(114).string(message.desktop_theme_id);
1738
+ }
1739
+ if (message._unknownFields !== undefined) {
1740
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1741
+ const tag = parseInt(key, 10);
1742
+ for (const value of values) {
1743
+ writer.uint32(tag).raw(value);
1744
+ }
1745
+ }
1746
+ }
1747
+ return writer;
1748
+ },
1749
+ decode(input, length) {
1750
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1751
+ const end = length === undefined ? reader.len : reader.pos + length;
1752
+ const message = createBaseProfileLoadout();
1753
+ while (reader.pos < end) {
1754
+ const tag = reader.uint32();
1755
+ switch (tag >>> 3) {
1756
+ case 1: {
1757
+ if (tag !== 10) {
1758
+ break;
1759
+ }
1760
+ message.frame_id = reader.string();
1761
+ continue;
1762
+ }
1763
+ case 2: {
1764
+ if (tag !== 18) {
1765
+ break;
1766
+ }
1767
+ message.title_id = reader.string();
1768
+ continue;
1769
+ }
1770
+ case 3: {
1771
+ if (tag !== 26) {
1772
+ break;
1773
+ }
1774
+ message.status_id = reader.string();
1775
+ continue;
1776
+ }
1777
+ case 4: {
1778
+ if (tag !== 34) {
1779
+ break;
1780
+ }
1781
+ message.palette_id = reader.string();
1782
+ continue;
1783
+ }
1784
+ case 5: {
1785
+ if (tag !== 42) {
1786
+ break;
1787
+ }
1788
+ message.font_id = reader.string();
1789
+ continue;
1790
+ }
1791
+ case 6: {
1792
+ if (tag !== 50) {
1793
+ break;
1794
+ }
1795
+ message.iconset_id = reader.string();
1796
+ continue;
1797
+ }
1798
+ case 7: {
1799
+ if (tag !== 58) {
1800
+ break;
1801
+ }
1802
+ message.layout_id = reader.string();
1803
+ continue;
1804
+ }
1805
+ case 8: {
1806
+ if (tag !== 66) {
1807
+ break;
1808
+ }
1809
+ message.border_id = reader.string();
1810
+ continue;
1811
+ }
1812
+ case 9: {
1813
+ if (tag !== 74) {
1814
+ break;
1815
+ }
1816
+ message.background = BackgroundLoadout.decode(reader, reader.uint32());
1817
+ continue;
1818
+ }
1819
+ case 10: {
1820
+ if (tag !== 82) {
1821
+ break;
1822
+ }
1823
+ message.banner_id = reader.string();
1824
+ continue;
1825
+ }
1826
+ case 11: {
1827
+ if (tag !== 90) {
1828
+ break;
1829
+ }
1830
+ message.effect_id = reader.string();
1831
+ continue;
1832
+ }
1833
+ case 12: {
1834
+ if (tag !== 98) {
1835
+ break;
1836
+ }
1837
+ message.showcase_id = reader.string();
1838
+ continue;
1839
+ }
1840
+ case 13: {
1841
+ if (tag !== 106) {
1842
+ break;
1843
+ }
1844
+ message.badges_id = reader.string();
1845
+ continue;
1846
+ }
1847
+ case 14: {
1848
+ if (tag !== 114) {
1849
+ break;
1850
+ }
1851
+ message.desktop_theme_id = reader.string();
1852
+ continue;
1853
+ }
1854
+ }
1855
+ if ((tag & 7) === 4 || tag === 0) {
1856
+ break;
1857
+ }
1858
+ const buf = reader.skip(tag & 7);
1859
+ const list = message._unknownFields[tag];
1860
+ if (list === undefined) {
1861
+ message._unknownFields[tag] = [buf];
1862
+ }
1863
+ else {
1864
+ list.push(buf);
1865
+ }
1866
+ }
1867
+ return message;
1868
+ },
1869
+ fromJSON(object) {
1870
+ return {
1871
+ frame_id: isSet(object.frameId)
1872
+ ? globalThis.String(object.frameId)
1873
+ : isSet(object.frame_id)
1874
+ ? globalThis.String(object.frame_id)
1875
+ : "",
1876
+ title_id: isSet(object.titleId)
1877
+ ? globalThis.String(object.titleId)
1878
+ : isSet(object.title_id)
1879
+ ? globalThis.String(object.title_id)
1880
+ : "",
1881
+ status_id: isSet(object.statusId)
1882
+ ? globalThis.String(object.statusId)
1883
+ : isSet(object.status_id)
1884
+ ? globalThis.String(object.status_id)
1885
+ : "",
1886
+ palette_id: isSet(object.paletteId)
1887
+ ? globalThis.String(object.paletteId)
1888
+ : isSet(object.palette_id)
1889
+ ? globalThis.String(object.palette_id)
1890
+ : "",
1891
+ font_id: isSet(object.fontId)
1892
+ ? globalThis.String(object.fontId)
1893
+ : isSet(object.font_id)
1894
+ ? globalThis.String(object.font_id)
1895
+ : "",
1896
+ iconset_id: isSet(object.iconsetId)
1897
+ ? globalThis.String(object.iconsetId)
1898
+ : isSet(object.iconset_id)
1899
+ ? globalThis.String(object.iconset_id)
1900
+ : "",
1901
+ layout_id: isSet(object.layoutId)
1902
+ ? globalThis.String(object.layoutId)
1903
+ : isSet(object.layout_id)
1904
+ ? globalThis.String(object.layout_id)
1905
+ : "",
1906
+ border_id: isSet(object.borderId)
1907
+ ? globalThis.String(object.borderId)
1908
+ : isSet(object.border_id)
1909
+ ? globalThis.String(object.border_id)
1910
+ : "",
1911
+ background: isSet(object.background) ? BackgroundLoadout.fromJSON(object.background) : undefined,
1912
+ banner_id: isSet(object.bannerId)
1913
+ ? globalThis.String(object.bannerId)
1914
+ : isSet(object.banner_id)
1915
+ ? globalThis.String(object.banner_id)
1916
+ : "",
1917
+ effect_id: isSet(object.effectId)
1918
+ ? globalThis.String(object.effectId)
1919
+ : isSet(object.effect_id)
1920
+ ? globalThis.String(object.effect_id)
1921
+ : "",
1922
+ showcase_id: isSet(object.showcaseId)
1923
+ ? globalThis.String(object.showcaseId)
1924
+ : isSet(object.showcase_id)
1925
+ ? globalThis.String(object.showcase_id)
1926
+ : "",
1927
+ badges_id: isSet(object.badgesId)
1928
+ ? globalThis.String(object.badgesId)
1929
+ : isSet(object.badges_id)
1930
+ ? globalThis.String(object.badges_id)
1931
+ : "",
1932
+ desktop_theme_id: isSet(object.desktopThemeId)
1933
+ ? globalThis.String(object.desktopThemeId)
1934
+ : isSet(object.desktop_theme_id)
1935
+ ? globalThis.String(object.desktop_theme_id)
1936
+ : "",
1937
+ };
1938
+ },
1939
+ toJSON(message) {
1940
+ const obj = {};
1941
+ if (message.frame_id !== "") {
1942
+ obj.frameId = message.frame_id;
1943
+ }
1944
+ if (message.title_id !== "") {
1945
+ obj.titleId = message.title_id;
1946
+ }
1947
+ if (message.status_id !== "") {
1948
+ obj.statusId = message.status_id;
1949
+ }
1950
+ if (message.palette_id !== "") {
1951
+ obj.paletteId = message.palette_id;
1952
+ }
1953
+ if (message.font_id !== "") {
1954
+ obj.fontId = message.font_id;
1955
+ }
1956
+ if (message.iconset_id !== "") {
1957
+ obj.iconsetId = message.iconset_id;
1958
+ }
1959
+ if (message.layout_id !== "") {
1960
+ obj.layoutId = message.layout_id;
1961
+ }
1962
+ if (message.border_id !== "") {
1963
+ obj.borderId = message.border_id;
1964
+ }
1965
+ if (message.background !== undefined) {
1966
+ obj.background = BackgroundLoadout.toJSON(message.background);
1967
+ }
1968
+ if (message.banner_id !== "") {
1969
+ obj.bannerId = message.banner_id;
1970
+ }
1971
+ if (message.effect_id !== "") {
1972
+ obj.effectId = message.effect_id;
1973
+ }
1974
+ if (message.showcase_id !== "") {
1975
+ obj.showcaseId = message.showcase_id;
1976
+ }
1977
+ if (message.badges_id !== "") {
1978
+ obj.badgesId = message.badges_id;
1979
+ }
1980
+ if (message.desktop_theme_id !== "") {
1981
+ obj.desktopThemeId = message.desktop_theme_id;
1982
+ }
1983
+ return obj;
1984
+ },
1985
+ create(base) {
1986
+ return ProfileLoadout.fromPartial(base ?? {});
1987
+ },
1988
+ fromPartial(object) {
1989
+ const message = createBaseProfileLoadout();
1990
+ message.frame_id = object.frame_id ?? "";
1991
+ message.title_id = object.title_id ?? "";
1992
+ message.status_id = object.status_id ?? "";
1993
+ message.palette_id = object.palette_id ?? "";
1994
+ message.font_id = object.font_id ?? "";
1995
+ message.iconset_id = object.iconset_id ?? "";
1996
+ message.layout_id = object.layout_id ?? "";
1997
+ message.border_id = object.border_id ?? "";
1998
+ message.background = (object.background !== undefined && object.background !== null)
1999
+ ? BackgroundLoadout.fromPartial(object.background)
2000
+ : undefined;
2001
+ message.banner_id = object.banner_id ?? "";
2002
+ message.effect_id = object.effect_id ?? "";
2003
+ message.showcase_id = object.showcase_id ?? "";
2004
+ message.badges_id = object.badges_id ?? "";
2005
+ message.desktop_theme_id = object.desktop_theme_id ?? "";
2006
+ return message;
2007
+ },
2008
+ };
2009
+ function createBaseListCosmeticsRequest() {
2010
+ return { slot: "", _unknownFields: {} };
2011
+ }
2012
+ export const ListCosmeticsRequest = {
2013
+ encode(message, writer = new BinaryWriter()) {
2014
+ if (message.slot !== "") {
2015
+ writer.uint32(10).string(message.slot);
2016
+ }
2017
+ if (message._unknownFields !== undefined) {
2018
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
2019
+ const tag = parseInt(key, 10);
2020
+ for (const value of values) {
2021
+ writer.uint32(tag).raw(value);
2022
+ }
2023
+ }
2024
+ }
2025
+ return writer;
2026
+ },
2027
+ decode(input, length) {
2028
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2029
+ const end = length === undefined ? reader.len : reader.pos + length;
2030
+ const message = createBaseListCosmeticsRequest();
2031
+ while (reader.pos < end) {
2032
+ const tag = reader.uint32();
2033
+ switch (tag >>> 3) {
2034
+ case 1: {
2035
+ if (tag !== 10) {
2036
+ break;
2037
+ }
2038
+ message.slot = reader.string();
2039
+ continue;
2040
+ }
2041
+ }
2042
+ if ((tag & 7) === 4 || tag === 0) {
2043
+ break;
2044
+ }
2045
+ const buf = reader.skip(tag & 7);
2046
+ const list = message._unknownFields[tag];
2047
+ if (list === undefined) {
2048
+ message._unknownFields[tag] = [buf];
2049
+ }
2050
+ else {
2051
+ list.push(buf);
2052
+ }
2053
+ }
2054
+ return message;
2055
+ },
2056
+ fromJSON(object) {
2057
+ return { slot: isSet(object.slot) ? globalThis.String(object.slot) : "" };
2058
+ },
2059
+ toJSON(message) {
2060
+ const obj = {};
2061
+ if (message.slot !== "") {
2062
+ obj.slot = message.slot;
2063
+ }
2064
+ return obj;
2065
+ },
2066
+ create(base) {
2067
+ return ListCosmeticsRequest.fromPartial(base ?? {});
2068
+ },
2069
+ fromPartial(object) {
2070
+ const message = createBaseListCosmeticsRequest();
2071
+ message.slot = object.slot ?? "";
2072
+ return message;
2073
+ },
2074
+ };
2075
+ function createBaseListCosmeticsResponse() {
2076
+ return { items: [], error: undefined, _unknownFields: {} };
2077
+ }
2078
+ export const ListCosmeticsResponse = {
2079
+ encode(message, writer = new BinaryWriter()) {
2080
+ for (const v of message.items) {
2081
+ Cosmetic.encode(v, writer.uint32(10).fork()).join();
2082
+ }
2083
+ if (message.error !== undefined) {
2084
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
2085
+ }
2086
+ if (message._unknownFields !== undefined) {
2087
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
2088
+ const tag = parseInt(key, 10);
2089
+ for (const value of values) {
2090
+ writer.uint32(tag).raw(value);
2091
+ }
2092
+ }
2093
+ }
2094
+ return writer;
2095
+ },
2096
+ decode(input, length) {
2097
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2098
+ const end = length === undefined ? reader.len : reader.pos + length;
2099
+ const message = createBaseListCosmeticsResponse();
2100
+ while (reader.pos < end) {
2101
+ const tag = reader.uint32();
2102
+ switch (tag >>> 3) {
2103
+ case 1: {
2104
+ if (tag !== 10) {
2105
+ break;
2106
+ }
2107
+ message.items.push(Cosmetic.decode(reader, reader.uint32()));
2108
+ continue;
2109
+ }
2110
+ case 15: {
2111
+ if (tag !== 122) {
2112
+ break;
2113
+ }
2114
+ message.error = ErrorInfo.decode(reader, reader.uint32());
2115
+ continue;
2116
+ }
2117
+ }
2118
+ if ((tag & 7) === 4 || tag === 0) {
2119
+ break;
2120
+ }
2121
+ const buf = reader.skip(tag & 7);
2122
+ const list = message._unknownFields[tag];
2123
+ if (list === undefined) {
2124
+ message._unknownFields[tag] = [buf];
2125
+ }
2126
+ else {
2127
+ list.push(buf);
2128
+ }
2129
+ }
2130
+ return message;
2131
+ },
2132
+ fromJSON(object) {
2133
+ return {
2134
+ items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => Cosmetic.fromJSON(e)) : [],
2135
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
2136
+ };
2137
+ },
2138
+ toJSON(message) {
2139
+ const obj = {};
2140
+ if (message.items?.length) {
2141
+ obj.items = message.items.map((e) => Cosmetic.toJSON(e));
2142
+ }
2143
+ if (message.error !== undefined) {
2144
+ obj.error = ErrorInfo.toJSON(message.error);
2145
+ }
2146
+ return obj;
2147
+ },
2148
+ create(base) {
2149
+ return ListCosmeticsResponse.fromPartial(base ?? {});
2150
+ },
2151
+ fromPartial(object) {
2152
+ const message = createBaseListCosmeticsResponse();
2153
+ message.items = object.items?.map((e) => Cosmetic.fromPartial(e)) || [];
2154
+ message.error = (object.error !== undefined && object.error !== null)
2155
+ ? ErrorInfo.fromPartial(object.error)
2156
+ : undefined;
2157
+ return message;
2158
+ },
2159
+ };
2160
+ function createBasePurchaseCosmeticRequest() {
2161
+ return { cosmetic_id: "", operation_id: "", _unknownFields: {} };
2162
+ }
2163
+ export const PurchaseCosmeticRequest = {
2164
+ encode(message, writer = new BinaryWriter()) {
2165
+ if (message.cosmetic_id !== "") {
2166
+ writer.uint32(10).string(message.cosmetic_id);
2167
+ }
2168
+ if (message.operation_id !== "") {
2169
+ writer.uint32(18).string(message.operation_id);
2170
+ }
2171
+ if (message._unknownFields !== undefined) {
2172
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
2173
+ const tag = parseInt(key, 10);
2174
+ for (const value of values) {
2175
+ writer.uint32(tag).raw(value);
2176
+ }
2177
+ }
2178
+ }
2179
+ return writer;
2180
+ },
2181
+ decode(input, length) {
2182
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2183
+ const end = length === undefined ? reader.len : reader.pos + length;
2184
+ const message = createBasePurchaseCosmeticRequest();
2185
+ while (reader.pos < end) {
2186
+ const tag = reader.uint32();
2187
+ switch (tag >>> 3) {
2188
+ case 1: {
2189
+ if (tag !== 10) {
2190
+ break;
2191
+ }
2192
+ message.cosmetic_id = reader.string();
2193
+ continue;
2194
+ }
2195
+ case 2: {
2196
+ if (tag !== 18) {
2197
+ break;
2198
+ }
2199
+ message.operation_id = reader.string();
2200
+ continue;
2201
+ }
2202
+ }
2203
+ if ((tag & 7) === 4 || tag === 0) {
2204
+ break;
2205
+ }
2206
+ const buf = reader.skip(tag & 7);
2207
+ const list = message._unknownFields[tag];
2208
+ if (list === undefined) {
2209
+ message._unknownFields[tag] = [buf];
2210
+ }
2211
+ else {
2212
+ list.push(buf);
2213
+ }
2214
+ }
2215
+ return message;
2216
+ },
2217
+ fromJSON(object) {
2218
+ return {
2219
+ cosmetic_id: isSet(object.cosmeticId)
2220
+ ? globalThis.String(object.cosmeticId)
2221
+ : isSet(object.cosmetic_id)
2222
+ ? globalThis.String(object.cosmetic_id)
2223
+ : "",
2224
+ operation_id: isSet(object.operationId)
2225
+ ? globalThis.String(object.operationId)
2226
+ : isSet(object.operation_id)
2227
+ ? globalThis.String(object.operation_id)
2228
+ : "",
2229
+ };
2230
+ },
2231
+ toJSON(message) {
2232
+ const obj = {};
2233
+ if (message.cosmetic_id !== "") {
2234
+ obj.cosmeticId = message.cosmetic_id;
2235
+ }
2236
+ if (message.operation_id !== "") {
2237
+ obj.operationId = message.operation_id;
2238
+ }
2239
+ return obj;
2240
+ },
2241
+ create(base) {
2242
+ return PurchaseCosmeticRequest.fromPartial(base ?? {});
2243
+ },
2244
+ fromPartial(object) {
2245
+ const message = createBasePurchaseCosmeticRequest();
2246
+ message.cosmetic_id = object.cosmetic_id ?? "";
2247
+ message.operation_id = object.operation_id ?? "";
2248
+ return message;
2249
+ },
2250
+ };
2251
+ function createBaseCosmeticPurchaseReceipt() {
2252
+ return {
2253
+ contract_version: "",
2254
+ operation_id: "",
2255
+ request_fingerprint: "",
2256
+ principal_id: "",
2257
+ cosmetic_id: "",
2258
+ price_shark: "0",
2259
+ status: "",
2260
+ reason: "",
2261
+ balance_after: "0",
2262
+ acquired_at_ms: "0",
2263
+ completed_at_ms: "0",
2264
+ replayed: false,
2265
+ currency: "",
2266
+ _unknownFields: {},
2267
+ };
2268
+ }
2269
+ export const CosmeticPurchaseReceipt = {
2270
+ encode(message, writer = new BinaryWriter()) {
2271
+ if (message.contract_version !== "") {
2272
+ writer.uint32(10).string(message.contract_version);
2273
+ }
2274
+ if (message.operation_id !== "") {
2275
+ writer.uint32(18).string(message.operation_id);
2276
+ }
2277
+ if (message.request_fingerprint !== "") {
2278
+ writer.uint32(26).string(message.request_fingerprint);
2279
+ }
2280
+ if (message.principal_id !== "") {
2281
+ writer.uint32(34).string(message.principal_id);
2282
+ }
2283
+ if (message.cosmetic_id !== "") {
2284
+ writer.uint32(42).string(message.cosmetic_id);
2285
+ }
2286
+ if (message.price_shark !== "0") {
2287
+ writer.uint32(48).int64(message.price_shark);
2288
+ }
2289
+ if (message.status !== "") {
2290
+ writer.uint32(58).string(message.status);
2291
+ }
2292
+ if (message.reason !== "") {
2293
+ writer.uint32(66).string(message.reason);
2294
+ }
2295
+ if (message.balance_after !== "0") {
2296
+ writer.uint32(72).int64(message.balance_after);
2297
+ }
2298
+ if (message.acquired_at_ms !== "0") {
2299
+ writer.uint32(80).int64(message.acquired_at_ms);
2300
+ }
2301
+ if (message.completed_at_ms !== "0") {
2302
+ writer.uint32(88).int64(message.completed_at_ms);
2303
+ }
2304
+ if (message.replayed !== false) {
2305
+ writer.uint32(96).bool(message.replayed);
2306
+ }
2307
+ if (message.currency !== "") {
2308
+ writer.uint32(106).string(message.currency);
2309
+ }
2310
+ if (message._unknownFields !== undefined) {
2311
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
2312
+ const tag = parseInt(key, 10);
2313
+ for (const value of values) {
2314
+ writer.uint32(tag).raw(value);
2315
+ }
2316
+ }
2317
+ }
2318
+ return writer;
2319
+ },
2320
+ decode(input, length) {
2321
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2322
+ const end = length === undefined ? reader.len : reader.pos + length;
2323
+ const message = createBaseCosmeticPurchaseReceipt();
2324
+ while (reader.pos < end) {
2325
+ const tag = reader.uint32();
2326
+ switch (tag >>> 3) {
2327
+ case 1: {
2328
+ if (tag !== 10) {
2329
+ break;
2330
+ }
2331
+ message.contract_version = reader.string();
2332
+ continue;
2333
+ }
2334
+ case 2: {
2335
+ if (tag !== 18) {
2336
+ break;
2337
+ }
2338
+ message.operation_id = reader.string();
2339
+ continue;
2340
+ }
2341
+ case 3: {
2342
+ if (tag !== 26) {
2343
+ break;
2344
+ }
2345
+ message.request_fingerprint = reader.string();
2346
+ continue;
2347
+ }
2348
+ case 4: {
2349
+ if (tag !== 34) {
2350
+ break;
2351
+ }
2352
+ message.principal_id = reader.string();
2353
+ continue;
2354
+ }
2355
+ case 5: {
2356
+ if (tag !== 42) {
2357
+ break;
2358
+ }
2359
+ message.cosmetic_id = reader.string();
2360
+ continue;
2361
+ }
2362
+ case 6: {
2363
+ if (tag !== 48) {
2364
+ break;
2365
+ }
2366
+ message.price_shark = reader.int64().toString();
2367
+ continue;
2368
+ }
2369
+ case 7: {
2370
+ if (tag !== 58) {
2371
+ break;
2372
+ }
2373
+ message.status = reader.string();
2374
+ continue;
2375
+ }
2376
+ case 8: {
2377
+ if (tag !== 66) {
2378
+ break;
2379
+ }
2380
+ message.reason = reader.string();
2381
+ continue;
2382
+ }
2383
+ case 9: {
2384
+ if (tag !== 72) {
2385
+ break;
2386
+ }
2387
+ message.balance_after = reader.int64().toString();
2388
+ continue;
2389
+ }
2390
+ case 10: {
2391
+ if (tag !== 80) {
2392
+ break;
2393
+ }
2394
+ message.acquired_at_ms = reader.int64().toString();
2395
+ continue;
2396
+ }
2397
+ case 11: {
2398
+ if (tag !== 88) {
2399
+ break;
2400
+ }
2401
+ message.completed_at_ms = reader.int64().toString();
2402
+ continue;
2403
+ }
2404
+ case 12: {
2405
+ if (tag !== 96) {
2406
+ break;
2407
+ }
2408
+ message.replayed = reader.bool();
2409
+ continue;
2410
+ }
2411
+ case 13: {
2412
+ if (tag !== 106) {
2413
+ break;
2414
+ }
2415
+ message.currency = reader.string();
2416
+ continue;
2417
+ }
2418
+ }
2419
+ if ((tag & 7) === 4 || tag === 0) {
2420
+ break;
2421
+ }
2422
+ const buf = reader.skip(tag & 7);
2423
+ const list = message._unknownFields[tag];
2424
+ if (list === undefined) {
2425
+ message._unknownFields[tag] = [buf];
2426
+ }
2427
+ else {
2428
+ list.push(buf);
2429
+ }
2430
+ }
2431
+ return message;
2432
+ },
2433
+ fromJSON(object) {
2434
+ return {
2435
+ contract_version: isSet(object.contractVersion)
2436
+ ? globalThis.String(object.contractVersion)
2437
+ : isSet(object.contract_version)
2438
+ ? globalThis.String(object.contract_version)
2439
+ : "",
2440
+ operation_id: isSet(object.operationId)
2441
+ ? globalThis.String(object.operationId)
2442
+ : isSet(object.operation_id)
2443
+ ? globalThis.String(object.operation_id)
2444
+ : "",
2445
+ request_fingerprint: isSet(object.requestFingerprint)
2446
+ ? globalThis.String(object.requestFingerprint)
2447
+ : isSet(object.request_fingerprint)
2448
+ ? globalThis.String(object.request_fingerprint)
2449
+ : "",
2450
+ principal_id: isSet(object.principalId)
2451
+ ? globalThis.String(object.principalId)
2452
+ : isSet(object.principal_id)
2453
+ ? globalThis.String(object.principal_id)
2454
+ : "",
2455
+ cosmetic_id: isSet(object.cosmeticId)
2456
+ ? globalThis.String(object.cosmeticId)
2457
+ : isSet(object.cosmetic_id)
2458
+ ? globalThis.String(object.cosmetic_id)
2459
+ : "",
2460
+ price_shark: isSet(object.priceShark)
2461
+ ? globalThis.String(object.priceShark)
2462
+ : isSet(object.price_shark)
2463
+ ? globalThis.String(object.price_shark)
2464
+ : "0",
2465
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
2466
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
2467
+ balance_after: isSet(object.balanceAfter)
2468
+ ? globalThis.String(object.balanceAfter)
2469
+ : isSet(object.balance_after)
2470
+ ? globalThis.String(object.balance_after)
2471
+ : "0",
2472
+ acquired_at_ms: isSet(object.acquiredAtMs)
2473
+ ? globalThis.String(object.acquiredAtMs)
2474
+ : isSet(object.acquired_at_ms)
2475
+ ? globalThis.String(object.acquired_at_ms)
2476
+ : "0",
2477
+ completed_at_ms: isSet(object.completedAtMs)
2478
+ ? globalThis.String(object.completedAtMs)
2479
+ : isSet(object.completed_at_ms)
2480
+ ? globalThis.String(object.completed_at_ms)
2481
+ : "0",
2482
+ replayed: isSet(object.replayed) ? globalThis.Boolean(object.replayed) : false,
2483
+ currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
2484
+ };
2485
+ },
2486
+ toJSON(message) {
2487
+ const obj = {};
2488
+ if (message.contract_version !== "") {
2489
+ obj.contractVersion = message.contract_version;
2490
+ }
2491
+ if (message.operation_id !== "") {
2492
+ obj.operationId = message.operation_id;
2493
+ }
2494
+ if (message.request_fingerprint !== "") {
2495
+ obj.requestFingerprint = message.request_fingerprint;
2496
+ }
2497
+ if (message.principal_id !== "") {
2498
+ obj.principalId = message.principal_id;
2499
+ }
2500
+ if (message.cosmetic_id !== "") {
2501
+ obj.cosmeticId = message.cosmetic_id;
2502
+ }
2503
+ if (message.price_shark !== "0") {
2504
+ obj.priceShark = message.price_shark;
2505
+ }
2506
+ if (message.status !== "") {
2507
+ obj.status = message.status;
2508
+ }
2509
+ if (message.reason !== "") {
2510
+ obj.reason = message.reason;
2511
+ }
2512
+ if (message.balance_after !== "0") {
2513
+ obj.balanceAfter = message.balance_after;
2514
+ }
2515
+ if (message.acquired_at_ms !== "0") {
2516
+ obj.acquiredAtMs = message.acquired_at_ms;
2517
+ }
2518
+ if (message.completed_at_ms !== "0") {
2519
+ obj.completedAtMs = message.completed_at_ms;
2520
+ }
2521
+ if (message.replayed !== false) {
2522
+ obj.replayed = message.replayed;
2523
+ }
2524
+ if (message.currency !== "") {
2525
+ obj.currency = message.currency;
2526
+ }
2527
+ return obj;
2528
+ },
2529
+ create(base) {
2530
+ return CosmeticPurchaseReceipt.fromPartial(base ?? {});
2531
+ },
2532
+ fromPartial(object) {
2533
+ const message = createBaseCosmeticPurchaseReceipt();
2534
+ message.contract_version = object.contract_version ?? "";
2535
+ message.operation_id = object.operation_id ?? "";
2536
+ message.request_fingerprint = object.request_fingerprint ?? "";
2537
+ message.principal_id = object.principal_id ?? "";
2538
+ message.cosmetic_id = object.cosmetic_id ?? "";
2539
+ message.price_shark = object.price_shark ?? "0";
2540
+ message.status = object.status ?? "";
2541
+ message.reason = object.reason ?? "";
2542
+ message.balance_after = object.balance_after ?? "0";
2543
+ message.acquired_at_ms = object.acquired_at_ms ?? "0";
2544
+ message.completed_at_ms = object.completed_at_ms ?? "0";
2545
+ message.replayed = object.replayed ?? false;
2546
+ message.currency = object.currency ?? "";
2547
+ return message;
2548
+ },
2549
+ };
2550
+ function createBasePurchaseCosmeticResponse() {
2551
+ return { ok: false, reason: "", new_shark_balance: "0", receipt: undefined, error: undefined, _unknownFields: {} };
2552
+ }
2553
+ export const PurchaseCosmeticResponse = {
2554
+ encode(message, writer = new BinaryWriter()) {
2555
+ if (message.ok !== false) {
2556
+ writer.uint32(8).bool(message.ok);
2557
+ }
2558
+ if (message.reason !== "") {
2559
+ writer.uint32(18).string(message.reason);
2560
+ }
2561
+ if (message.new_shark_balance !== "0") {
2562
+ writer.uint32(24).int64(message.new_shark_balance);
2563
+ }
2564
+ if (message.receipt !== undefined) {
2565
+ CosmeticPurchaseReceipt.encode(message.receipt, writer.uint32(34).fork()).join();
2566
+ }
2567
+ if (message.error !== undefined) {
2568
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
2569
+ }
2570
+ if (message._unknownFields !== undefined) {
2571
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
2572
+ const tag = parseInt(key, 10);
2573
+ for (const value of values) {
2574
+ writer.uint32(tag).raw(value);
2575
+ }
2576
+ }
2577
+ }
2578
+ return writer;
2579
+ },
2580
+ decode(input, length) {
2581
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2582
+ const end = length === undefined ? reader.len : reader.pos + length;
2583
+ const message = createBasePurchaseCosmeticResponse();
2584
+ while (reader.pos < end) {
2585
+ const tag = reader.uint32();
2586
+ switch (tag >>> 3) {
2587
+ case 1: {
2588
+ if (tag !== 8) {
2589
+ break;
2590
+ }
2591
+ message.ok = reader.bool();
2592
+ continue;
2593
+ }
2594
+ case 2: {
2595
+ if (tag !== 18) {
2596
+ break;
2597
+ }
2598
+ message.reason = reader.string();
2599
+ continue;
2600
+ }
2601
+ case 3: {
2602
+ if (tag !== 24) {
2603
+ break;
2604
+ }
2605
+ message.new_shark_balance = reader.int64().toString();
2606
+ continue;
2607
+ }
2608
+ case 4: {
2609
+ if (tag !== 34) {
2610
+ break;
2611
+ }
2612
+ message.receipt = CosmeticPurchaseReceipt.decode(reader, reader.uint32());
2613
+ continue;
2614
+ }
2615
+ case 15: {
2616
+ if (tag !== 122) {
2617
+ break;
2618
+ }
2619
+ message.error = ErrorInfo.decode(reader, reader.uint32());
2620
+ continue;
2621
+ }
2622
+ }
2623
+ if ((tag & 7) === 4 || tag === 0) {
2624
+ break;
2625
+ }
2626
+ const buf = reader.skip(tag & 7);
2627
+ const list = message._unknownFields[tag];
2628
+ if (list === undefined) {
2629
+ message._unknownFields[tag] = [buf];
2630
+ }
2631
+ else {
2632
+ list.push(buf);
2633
+ }
2634
+ }
2635
+ return message;
2636
+ },
2637
+ fromJSON(object) {
2638
+ return {
2639
+ ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false,
2640
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
2641
+ new_shark_balance: isSet(object.newSharkBalance)
2642
+ ? globalThis.String(object.newSharkBalance)
2643
+ : isSet(object.new_shark_balance)
2644
+ ? globalThis.String(object.new_shark_balance)
2645
+ : "0",
2646
+ receipt: isSet(object.receipt) ? CosmeticPurchaseReceipt.fromJSON(object.receipt) : undefined,
2647
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
2648
+ };
2649
+ },
2650
+ toJSON(message) {
2651
+ const obj = {};
2652
+ if (message.ok !== false) {
2653
+ obj.ok = message.ok;
2654
+ }
2655
+ if (message.reason !== "") {
2656
+ obj.reason = message.reason;
2657
+ }
2658
+ if (message.new_shark_balance !== "0") {
2659
+ obj.newSharkBalance = message.new_shark_balance;
2660
+ }
2661
+ if (message.receipt !== undefined) {
2662
+ obj.receipt = CosmeticPurchaseReceipt.toJSON(message.receipt);
2663
+ }
2664
+ if (message.error !== undefined) {
2665
+ obj.error = ErrorInfo.toJSON(message.error);
2666
+ }
2667
+ return obj;
2668
+ },
2669
+ create(base) {
2670
+ return PurchaseCosmeticResponse.fromPartial(base ?? {});
2671
+ },
2672
+ fromPartial(object) {
2673
+ const message = createBasePurchaseCosmeticResponse();
2674
+ message.ok = object.ok ?? false;
2675
+ message.reason = object.reason ?? "";
2676
+ message.new_shark_balance = object.new_shark_balance ?? "0";
2677
+ message.receipt = (object.receipt !== undefined && object.receipt !== null)
2678
+ ? CosmeticPurchaseReceipt.fromPartial(object.receipt)
2679
+ : undefined;
2680
+ message.error = (object.error !== undefined && object.error !== null)
2681
+ ? ErrorInfo.fromPartial(object.error)
2682
+ : undefined;
2683
+ return message;
2684
+ },
2685
+ };
2686
+ function createBaseUserSearchItem() {
2687
+ return { user_id: "", display_name: "", discriminator: 0, _unknownFields: {} };
2688
+ }
2689
+ export const UserSearchItem = {
2690
+ encode(message, writer = new BinaryWriter()) {
2691
+ if (message.user_id !== "") {
2692
+ writer.uint32(10).string(message.user_id);
2693
+ }
2694
+ if (message.display_name !== "") {
2695
+ writer.uint32(18).string(message.display_name);
2696
+ }
2697
+ if (message.discriminator !== 0) {
2698
+ writer.uint32(24).int32(message.discriminator);
2699
+ }
2700
+ if (message._unknownFields !== undefined) {
2701
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
2702
+ const tag = parseInt(key, 10);
2703
+ for (const value of values) {
2704
+ writer.uint32(tag).raw(value);
2705
+ }
2706
+ }
2707
+ }
2708
+ return writer;
2709
+ },
2710
+ decode(input, length) {
2711
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2712
+ const end = length === undefined ? reader.len : reader.pos + length;
2713
+ const message = createBaseUserSearchItem();
2714
+ while (reader.pos < end) {
2715
+ const tag = reader.uint32();
2716
+ switch (tag >>> 3) {
2717
+ case 1: {
2718
+ if (tag !== 10) {
2719
+ break;
2720
+ }
2721
+ message.user_id = reader.string();
2722
+ continue;
2723
+ }
2724
+ case 2: {
2725
+ if (tag !== 18) {
2726
+ break;
2727
+ }
2728
+ message.display_name = reader.string();
2729
+ continue;
2730
+ }
2731
+ case 3: {
2732
+ if (tag !== 24) {
2733
+ break;
2734
+ }
2735
+ message.discriminator = reader.int32();
2736
+ continue;
2737
+ }
2738
+ }
2739
+ if ((tag & 7) === 4 || tag === 0) {
2740
+ break;
2741
+ }
2742
+ const buf = reader.skip(tag & 7);
2743
+ const list = message._unknownFields[tag];
2744
+ if (list === undefined) {
2745
+ message._unknownFields[tag] = [buf];
2746
+ }
2747
+ else {
2748
+ list.push(buf);
2749
+ }
2750
+ }
2751
+ return message;
2752
+ },
2753
+ fromJSON(object) {
2754
+ return {
2755
+ user_id: isSet(object.userId)
2756
+ ? globalThis.String(object.userId)
2757
+ : isSet(object.user_id)
2758
+ ? globalThis.String(object.user_id)
2759
+ : "",
2760
+ display_name: isSet(object.displayName)
2761
+ ? globalThis.String(object.displayName)
2762
+ : isSet(object.display_name)
2763
+ ? globalThis.String(object.display_name)
2764
+ : "",
2765
+ discriminator: isSet(object.discriminator) ? globalThis.Number(object.discriminator) : 0,
2766
+ };
2767
+ },
2768
+ toJSON(message) {
2769
+ const obj = {};
2770
+ if (message.user_id !== "") {
2771
+ obj.userId = message.user_id;
2772
+ }
2773
+ if (message.display_name !== "") {
2774
+ obj.displayName = message.display_name;
2775
+ }
2776
+ if (message.discriminator !== 0) {
2777
+ obj.discriminator = Math.round(message.discriminator);
2778
+ }
2779
+ return obj;
2780
+ },
2781
+ create(base) {
2782
+ return UserSearchItem.fromPartial(base ?? {});
2783
+ },
2784
+ fromPartial(object) {
2785
+ const message = createBaseUserSearchItem();
2786
+ message.user_id = object.user_id ?? "";
2787
+ message.display_name = object.display_name ?? "";
2788
+ message.discriminator = object.discriminator ?? 0;
2789
+ return message;
2790
+ },
2791
+ };
2792
+ function createBaseUserSearchResponse() {
2793
+ return { items: [], error: undefined, _unknownFields: {} };
2794
+ }
2795
+ export const UserSearchResponse = {
2796
+ encode(message, writer = new BinaryWriter()) {
2797
+ for (const v of message.items) {
2798
+ UserSearchItem.encode(v, writer.uint32(10).fork()).join();
2799
+ }
2800
+ if (message.error !== undefined) {
2801
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
2802
+ }
2803
+ if (message._unknownFields !== undefined) {
2804
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
2805
+ const tag = parseInt(key, 10);
2806
+ for (const value of values) {
2807
+ writer.uint32(tag).raw(value);
2808
+ }
2809
+ }
2810
+ }
2811
+ return writer;
2812
+ },
2813
+ decode(input, length) {
2814
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2815
+ const end = length === undefined ? reader.len : reader.pos + length;
2816
+ const message = createBaseUserSearchResponse();
2817
+ while (reader.pos < end) {
2818
+ const tag = reader.uint32();
2819
+ switch (tag >>> 3) {
2820
+ case 1: {
2821
+ if (tag !== 10) {
2822
+ break;
2823
+ }
2824
+ message.items.push(UserSearchItem.decode(reader, reader.uint32()));
2825
+ continue;
2826
+ }
2827
+ case 15: {
2828
+ if (tag !== 122) {
2829
+ break;
2830
+ }
2831
+ message.error = ErrorInfo.decode(reader, reader.uint32());
2832
+ continue;
2833
+ }
2834
+ }
2835
+ if ((tag & 7) === 4 || tag === 0) {
2836
+ break;
2837
+ }
2838
+ const buf = reader.skip(tag & 7);
2839
+ const list = message._unknownFields[tag];
2840
+ if (list === undefined) {
2841
+ message._unknownFields[tag] = [buf];
2842
+ }
2843
+ else {
2844
+ list.push(buf);
2845
+ }
2846
+ }
2847
+ return message;
2848
+ },
2849
+ fromJSON(object) {
2850
+ return {
2851
+ items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => UserSearchItem.fromJSON(e)) : [],
2852
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
2853
+ };
2854
+ },
2855
+ toJSON(message) {
2856
+ const obj = {};
2857
+ if (message.items?.length) {
2858
+ obj.items = message.items.map((e) => UserSearchItem.toJSON(e));
2859
+ }
2860
+ if (message.error !== undefined) {
2861
+ obj.error = ErrorInfo.toJSON(message.error);
2862
+ }
2863
+ return obj;
2864
+ },
2865
+ create(base) {
2866
+ return UserSearchResponse.fromPartial(base ?? {});
2867
+ },
2868
+ fromPartial(object) {
2869
+ const message = createBaseUserSearchResponse();
2870
+ message.items = object.items?.map((e) => UserSearchItem.fromPartial(e)) || [];
2871
+ message.error = (object.error !== undefined && object.error !== null)
2872
+ ? ErrorInfo.fromPartial(object.error)
2873
+ : undefined;
2874
+ return message;
2875
+ },
2876
+ };
2877
+ function isSet(value) {
2878
+ return value !== null && value !== undefined;
2879
+ }