@latticexyz/services 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/bin/ecs-snapshot +0 -0
- package/bin/ecs-stream +0 -0
- package/bin/snapshots/SerializedWorlds +0 -0
- package/package.json +29 -0
- package/protobuf/go/ecs-snapshot/ecs-snapshot.pb.go +811 -0
- package/protobuf/go/ecs-snapshot/ecs-snapshot_grpc.pb.go +288 -0
- package/protobuf/go/ecs-stream/ecs-stream.pb.go +407 -0
- package/protobuf/go/ecs-stream/ecs-stream_grpc.pb.go +134 -0
- package/protobuf/ts/ecs-snapshot/ecs-snapshot.client.ts +134 -0
- package/protobuf/ts/ecs-snapshot/ecs-snapshot.ts +669 -0
- package/protobuf/ts/ecs-stream/ecs-stream.client.ts +58 -0
- package/protobuf/ts/ecs-stream/ecs-stream.ts +343 -0
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @generated by protobuf-ts 2.7.0 with parameter eslint_disable
|
|
3
|
+
// @generated from protobuf file "ecs-snapshot.proto" (package "ecssnapshot", syntax proto3)
|
|
4
|
+
// tslint:disable
|
|
5
|
+
import { ServiceType } from "@protobuf-ts/runtime-rpc";
|
|
6
|
+
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
7
|
+
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
8
|
+
import { WireType } from "@protobuf-ts/runtime";
|
|
9
|
+
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
10
|
+
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
11
|
+
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
12
|
+
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
13
|
+
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
14
|
+
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
|
|
15
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
16
|
+
/**
|
|
17
|
+
* @generated from protobuf message ecssnapshot.ECSState
|
|
18
|
+
*/
|
|
19
|
+
export interface ECSState {
|
|
20
|
+
/**
|
|
21
|
+
* @generated from protobuf field: uint32 component_id_idx = 1;
|
|
22
|
+
*/
|
|
23
|
+
componentIdIdx: number;
|
|
24
|
+
/**
|
|
25
|
+
* @generated from protobuf field: uint32 entity_id_idx = 2;
|
|
26
|
+
*/
|
|
27
|
+
entityIdIdx: number;
|
|
28
|
+
/**
|
|
29
|
+
* @generated from protobuf field: bytes value = 3;
|
|
30
|
+
*/
|
|
31
|
+
value: Uint8Array;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @generated from protobuf message ecssnapshot.ECSStateSnapshot
|
|
35
|
+
*/
|
|
36
|
+
export interface ECSStateSnapshot {
|
|
37
|
+
/**
|
|
38
|
+
* @generated from protobuf field: repeated ecssnapshot.ECSState state = 1;
|
|
39
|
+
*/
|
|
40
|
+
state: ECSState[];
|
|
41
|
+
/**
|
|
42
|
+
* @generated from protobuf field: repeated string stateComponents = 2;
|
|
43
|
+
*/
|
|
44
|
+
stateComponents: string[];
|
|
45
|
+
/**
|
|
46
|
+
* @generated from protobuf field: repeated string stateEntities = 3;
|
|
47
|
+
*/
|
|
48
|
+
stateEntities: string[];
|
|
49
|
+
/**
|
|
50
|
+
* @generated from protobuf field: string stateHash = 4;
|
|
51
|
+
*/
|
|
52
|
+
stateHash: string;
|
|
53
|
+
/**
|
|
54
|
+
* @generated from protobuf field: uint32 startBlockNumber = 5;
|
|
55
|
+
*/
|
|
56
|
+
startBlockNumber: number;
|
|
57
|
+
/**
|
|
58
|
+
* @generated from protobuf field: uint32 endBlockNumber = 6;
|
|
59
|
+
*/
|
|
60
|
+
endBlockNumber: number;
|
|
61
|
+
/**
|
|
62
|
+
* @generated from protobuf field: string worldAddress = 7;
|
|
63
|
+
*/
|
|
64
|
+
worldAddress: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @generated from protobuf message ecssnapshot.Worlds
|
|
68
|
+
*/
|
|
69
|
+
export interface Worlds {
|
|
70
|
+
/**
|
|
71
|
+
* @generated from protobuf field: repeated string worldAddress = 1;
|
|
72
|
+
*/
|
|
73
|
+
worldAddress: string[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The request message for the latest ECS state.
|
|
77
|
+
*
|
|
78
|
+
* @generated from protobuf message ecssnapshot.ECSStateRequestLatest
|
|
79
|
+
*/
|
|
80
|
+
export interface ECSStateRequestLatest {
|
|
81
|
+
/**
|
|
82
|
+
* @generated from protobuf field: string worldAddress = 1;
|
|
83
|
+
*/
|
|
84
|
+
worldAddress: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The request message for the latest block based on latest ECS state.
|
|
88
|
+
*
|
|
89
|
+
* @generated from protobuf message ecssnapshot.ECSStateBlockRequestLatest
|
|
90
|
+
*/
|
|
91
|
+
export interface ECSStateBlockRequestLatest {
|
|
92
|
+
/**
|
|
93
|
+
* @generated from protobuf field: string worldAddress = 1;
|
|
94
|
+
*/
|
|
95
|
+
worldAddress: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The request message for the ECS state given a block number.
|
|
99
|
+
*
|
|
100
|
+
* @generated from protobuf message ecssnapshot.ECSStateRequestAtBlock
|
|
101
|
+
*/
|
|
102
|
+
export interface ECSStateRequestAtBlock {
|
|
103
|
+
/**
|
|
104
|
+
* @generated from protobuf field: uint64 blockNumber = 1;
|
|
105
|
+
*/
|
|
106
|
+
blockNumber: bigint;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The request message for all worlds.
|
|
110
|
+
*
|
|
111
|
+
* @generated from protobuf message ecssnapshot.WorldsRequest
|
|
112
|
+
*/
|
|
113
|
+
export interface WorldsRequest {}
|
|
114
|
+
/**
|
|
115
|
+
* The response message containing the current state, hash of that state, and the block number of that state.
|
|
116
|
+
*
|
|
117
|
+
* @generated from protobuf message ecssnapshot.ECSStateReply
|
|
118
|
+
*/
|
|
119
|
+
export interface ECSStateReply {
|
|
120
|
+
/**
|
|
121
|
+
* @generated from protobuf field: repeated ecssnapshot.ECSState state = 1;
|
|
122
|
+
*/
|
|
123
|
+
state: ECSState[];
|
|
124
|
+
/**
|
|
125
|
+
* @generated from protobuf field: repeated string stateComponents = 2;
|
|
126
|
+
*/
|
|
127
|
+
stateComponents: string[];
|
|
128
|
+
/**
|
|
129
|
+
* @generated from protobuf field: repeated string stateEntities = 3;
|
|
130
|
+
*/
|
|
131
|
+
stateEntities: string[];
|
|
132
|
+
/**
|
|
133
|
+
* @generated from protobuf field: string stateHash = 4;
|
|
134
|
+
*/
|
|
135
|
+
stateHash: string;
|
|
136
|
+
/**
|
|
137
|
+
* @generated from protobuf field: uint32 blockNumber = 5;
|
|
138
|
+
*/
|
|
139
|
+
blockNumber: number;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @generated from protobuf message ecssnapshot.ECSStateBlockReply
|
|
143
|
+
*/
|
|
144
|
+
export interface ECSStateBlockReply {
|
|
145
|
+
/**
|
|
146
|
+
* @generated from protobuf field: uint32 blockNumber = 1;
|
|
147
|
+
*/
|
|
148
|
+
blockNumber: number;
|
|
149
|
+
}
|
|
150
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
151
|
+
class ECSState$Type extends MessageType<ECSState> {
|
|
152
|
+
constructor() {
|
|
153
|
+
super("ecssnapshot.ECSState", [
|
|
154
|
+
{ no: 1, name: "component_id_idx", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
155
|
+
{ no: 2, name: "entity_id_idx", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
156
|
+
{ no: 3, name: "value", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
157
|
+
]);
|
|
158
|
+
}
|
|
159
|
+
create(value?: PartialMessage<ECSState>): ECSState {
|
|
160
|
+
const message = { componentIdIdx: 0, entityIdIdx: 0, value: new Uint8Array(0) };
|
|
161
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
162
|
+
if (value !== undefined) reflectionMergePartial<ECSState>(this, message, value);
|
|
163
|
+
return message;
|
|
164
|
+
}
|
|
165
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ECSState): ECSState {
|
|
166
|
+
let message = target ?? this.create(),
|
|
167
|
+
end = reader.pos + length;
|
|
168
|
+
while (reader.pos < end) {
|
|
169
|
+
let [fieldNo, wireType] = reader.tag();
|
|
170
|
+
switch (fieldNo) {
|
|
171
|
+
case /* uint32 component_id_idx */ 1:
|
|
172
|
+
message.componentIdIdx = reader.uint32();
|
|
173
|
+
break;
|
|
174
|
+
case /* uint32 entity_id_idx */ 2:
|
|
175
|
+
message.entityIdIdx = reader.uint32();
|
|
176
|
+
break;
|
|
177
|
+
case /* bytes value */ 3:
|
|
178
|
+
message.value = reader.bytes();
|
|
179
|
+
break;
|
|
180
|
+
default:
|
|
181
|
+
let u = options.readUnknownField;
|
|
182
|
+
if (u === "throw")
|
|
183
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
184
|
+
let d = reader.skip(wireType);
|
|
185
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return message;
|
|
189
|
+
}
|
|
190
|
+
internalBinaryWrite(message: ECSState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
191
|
+
/* uint32 component_id_idx = 1; */
|
|
192
|
+
if (message.componentIdIdx !== 0) writer.tag(1, WireType.Varint).uint32(message.componentIdIdx);
|
|
193
|
+
/* uint32 entity_id_idx = 2; */
|
|
194
|
+
if (message.entityIdIdx !== 0) writer.tag(2, WireType.Varint).uint32(message.entityIdIdx);
|
|
195
|
+
/* bytes value = 3; */
|
|
196
|
+
if (message.value.length) writer.tag(3, WireType.LengthDelimited).bytes(message.value);
|
|
197
|
+
let u = options.writeUnknownFields;
|
|
198
|
+
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
199
|
+
return writer;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @generated MessageType for protobuf message ecssnapshot.ECSState
|
|
204
|
+
*/
|
|
205
|
+
export const ECSState = new ECSState$Type();
|
|
206
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
207
|
+
class ECSStateSnapshot$Type extends MessageType<ECSStateSnapshot> {
|
|
208
|
+
constructor() {
|
|
209
|
+
super("ecssnapshot.ECSStateSnapshot", [
|
|
210
|
+
{ no: 1, name: "state", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ECSState },
|
|
211
|
+
{ no: 2, name: "stateComponents", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
212
|
+
{ no: 3, name: "stateEntities", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
213
|
+
{ no: 4, name: "stateHash", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
214
|
+
{ no: 5, name: "startBlockNumber", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
215
|
+
{ no: 6, name: "endBlockNumber", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
216
|
+
{ no: 7, name: "worldAddress", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
217
|
+
]);
|
|
218
|
+
}
|
|
219
|
+
create(value?: PartialMessage<ECSStateSnapshot>): ECSStateSnapshot {
|
|
220
|
+
const message = {
|
|
221
|
+
state: [],
|
|
222
|
+
stateComponents: [],
|
|
223
|
+
stateEntities: [],
|
|
224
|
+
stateHash: "",
|
|
225
|
+
startBlockNumber: 0,
|
|
226
|
+
endBlockNumber: 0,
|
|
227
|
+
worldAddress: "",
|
|
228
|
+
};
|
|
229
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
230
|
+
if (value !== undefined) reflectionMergePartial<ECSStateSnapshot>(this, message, value);
|
|
231
|
+
return message;
|
|
232
|
+
}
|
|
233
|
+
internalBinaryRead(
|
|
234
|
+
reader: IBinaryReader,
|
|
235
|
+
length: number,
|
|
236
|
+
options: BinaryReadOptions,
|
|
237
|
+
target?: ECSStateSnapshot
|
|
238
|
+
): ECSStateSnapshot {
|
|
239
|
+
let message = target ?? this.create(),
|
|
240
|
+
end = reader.pos + length;
|
|
241
|
+
while (reader.pos < end) {
|
|
242
|
+
let [fieldNo, wireType] = reader.tag();
|
|
243
|
+
switch (fieldNo) {
|
|
244
|
+
case /* repeated ecssnapshot.ECSState state */ 1:
|
|
245
|
+
message.state.push(ECSState.internalBinaryRead(reader, reader.uint32(), options));
|
|
246
|
+
break;
|
|
247
|
+
case /* repeated string stateComponents */ 2:
|
|
248
|
+
message.stateComponents.push(reader.string());
|
|
249
|
+
break;
|
|
250
|
+
case /* repeated string stateEntities */ 3:
|
|
251
|
+
message.stateEntities.push(reader.string());
|
|
252
|
+
break;
|
|
253
|
+
case /* string stateHash */ 4:
|
|
254
|
+
message.stateHash = reader.string();
|
|
255
|
+
break;
|
|
256
|
+
case /* uint32 startBlockNumber */ 5:
|
|
257
|
+
message.startBlockNumber = reader.uint32();
|
|
258
|
+
break;
|
|
259
|
+
case /* uint32 endBlockNumber */ 6:
|
|
260
|
+
message.endBlockNumber = reader.uint32();
|
|
261
|
+
break;
|
|
262
|
+
case /* string worldAddress */ 7:
|
|
263
|
+
message.worldAddress = reader.string();
|
|
264
|
+
break;
|
|
265
|
+
default:
|
|
266
|
+
let u = options.readUnknownField;
|
|
267
|
+
if (u === "throw")
|
|
268
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
269
|
+
let d = reader.skip(wireType);
|
|
270
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return message;
|
|
274
|
+
}
|
|
275
|
+
internalBinaryWrite(message: ECSStateSnapshot, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
276
|
+
/* repeated ecssnapshot.ECSState state = 1; */
|
|
277
|
+
for (let i = 0; i < message.state.length; i++)
|
|
278
|
+
ECSState.internalBinaryWrite(message.state[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
279
|
+
/* repeated string stateComponents = 2; */
|
|
280
|
+
for (let i = 0; i < message.stateComponents.length; i++)
|
|
281
|
+
writer.tag(2, WireType.LengthDelimited).string(message.stateComponents[i]);
|
|
282
|
+
/* repeated string stateEntities = 3; */
|
|
283
|
+
for (let i = 0; i < message.stateEntities.length; i++)
|
|
284
|
+
writer.tag(3, WireType.LengthDelimited).string(message.stateEntities[i]);
|
|
285
|
+
/* string stateHash = 4; */
|
|
286
|
+
if (message.stateHash !== "") writer.tag(4, WireType.LengthDelimited).string(message.stateHash);
|
|
287
|
+
/* uint32 startBlockNumber = 5; */
|
|
288
|
+
if (message.startBlockNumber !== 0) writer.tag(5, WireType.Varint).uint32(message.startBlockNumber);
|
|
289
|
+
/* uint32 endBlockNumber = 6; */
|
|
290
|
+
if (message.endBlockNumber !== 0) writer.tag(6, WireType.Varint).uint32(message.endBlockNumber);
|
|
291
|
+
/* string worldAddress = 7; */
|
|
292
|
+
if (message.worldAddress !== "") writer.tag(7, WireType.LengthDelimited).string(message.worldAddress);
|
|
293
|
+
let u = options.writeUnknownFields;
|
|
294
|
+
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
295
|
+
return writer;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* @generated MessageType for protobuf message ecssnapshot.ECSStateSnapshot
|
|
300
|
+
*/
|
|
301
|
+
export const ECSStateSnapshot = new ECSStateSnapshot$Type();
|
|
302
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
303
|
+
class Worlds$Type extends MessageType<Worlds> {
|
|
304
|
+
constructor() {
|
|
305
|
+
super("ecssnapshot.Worlds", [
|
|
306
|
+
{ no: 1, name: "worldAddress", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
307
|
+
]);
|
|
308
|
+
}
|
|
309
|
+
create(value?: PartialMessage<Worlds>): Worlds {
|
|
310
|
+
const message = { worldAddress: [] };
|
|
311
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
312
|
+
if (value !== undefined) reflectionMergePartial<Worlds>(this, message, value);
|
|
313
|
+
return message;
|
|
314
|
+
}
|
|
315
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Worlds): Worlds {
|
|
316
|
+
let message = target ?? this.create(),
|
|
317
|
+
end = reader.pos + length;
|
|
318
|
+
while (reader.pos < end) {
|
|
319
|
+
let [fieldNo, wireType] = reader.tag();
|
|
320
|
+
switch (fieldNo) {
|
|
321
|
+
case /* repeated string worldAddress */ 1:
|
|
322
|
+
message.worldAddress.push(reader.string());
|
|
323
|
+
break;
|
|
324
|
+
default:
|
|
325
|
+
let u = options.readUnknownField;
|
|
326
|
+
if (u === "throw")
|
|
327
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
328
|
+
let d = reader.skip(wireType);
|
|
329
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return message;
|
|
333
|
+
}
|
|
334
|
+
internalBinaryWrite(message: Worlds, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
335
|
+
/* repeated string worldAddress = 1; */
|
|
336
|
+
for (let i = 0; i < message.worldAddress.length; i++)
|
|
337
|
+
writer.tag(1, WireType.LengthDelimited).string(message.worldAddress[i]);
|
|
338
|
+
let u = options.writeUnknownFields;
|
|
339
|
+
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
340
|
+
return writer;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* @generated MessageType for protobuf message ecssnapshot.Worlds
|
|
345
|
+
*/
|
|
346
|
+
export const Worlds = new Worlds$Type();
|
|
347
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
348
|
+
class ECSStateRequestLatest$Type extends MessageType<ECSStateRequestLatest> {
|
|
349
|
+
constructor() {
|
|
350
|
+
super("ecssnapshot.ECSStateRequestLatest", [
|
|
351
|
+
{ no: 1, name: "worldAddress", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
352
|
+
]);
|
|
353
|
+
}
|
|
354
|
+
create(value?: PartialMessage<ECSStateRequestLatest>): ECSStateRequestLatest {
|
|
355
|
+
const message = { worldAddress: "" };
|
|
356
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
357
|
+
if (value !== undefined) reflectionMergePartial<ECSStateRequestLatest>(this, message, value);
|
|
358
|
+
return message;
|
|
359
|
+
}
|
|
360
|
+
internalBinaryRead(
|
|
361
|
+
reader: IBinaryReader,
|
|
362
|
+
length: number,
|
|
363
|
+
options: BinaryReadOptions,
|
|
364
|
+
target?: ECSStateRequestLatest
|
|
365
|
+
): ECSStateRequestLatest {
|
|
366
|
+
let message = target ?? this.create(),
|
|
367
|
+
end = reader.pos + length;
|
|
368
|
+
while (reader.pos < end) {
|
|
369
|
+
let [fieldNo, wireType] = reader.tag();
|
|
370
|
+
switch (fieldNo) {
|
|
371
|
+
case /* string worldAddress */ 1:
|
|
372
|
+
message.worldAddress = reader.string();
|
|
373
|
+
break;
|
|
374
|
+
default:
|
|
375
|
+
let u = options.readUnknownField;
|
|
376
|
+
if (u === "throw")
|
|
377
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
378
|
+
let d = reader.skip(wireType);
|
|
379
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return message;
|
|
383
|
+
}
|
|
384
|
+
internalBinaryWrite(
|
|
385
|
+
message: ECSStateRequestLatest,
|
|
386
|
+
writer: IBinaryWriter,
|
|
387
|
+
options: BinaryWriteOptions
|
|
388
|
+
): IBinaryWriter {
|
|
389
|
+
/* string worldAddress = 1; */
|
|
390
|
+
if (message.worldAddress !== "") writer.tag(1, WireType.LengthDelimited).string(message.worldAddress);
|
|
391
|
+
let u = options.writeUnknownFields;
|
|
392
|
+
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
393
|
+
return writer;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* @generated MessageType for protobuf message ecssnapshot.ECSStateRequestLatest
|
|
398
|
+
*/
|
|
399
|
+
export const ECSStateRequestLatest = new ECSStateRequestLatest$Type();
|
|
400
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
401
|
+
class ECSStateBlockRequestLatest$Type extends MessageType<ECSStateBlockRequestLatest> {
|
|
402
|
+
constructor() {
|
|
403
|
+
super("ecssnapshot.ECSStateBlockRequestLatest", [
|
|
404
|
+
{ no: 1, name: "worldAddress", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
405
|
+
]);
|
|
406
|
+
}
|
|
407
|
+
create(value?: PartialMessage<ECSStateBlockRequestLatest>): ECSStateBlockRequestLatest {
|
|
408
|
+
const message = { worldAddress: "" };
|
|
409
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
410
|
+
if (value !== undefined) reflectionMergePartial<ECSStateBlockRequestLatest>(this, message, value);
|
|
411
|
+
return message;
|
|
412
|
+
}
|
|
413
|
+
internalBinaryRead(
|
|
414
|
+
reader: IBinaryReader,
|
|
415
|
+
length: number,
|
|
416
|
+
options: BinaryReadOptions,
|
|
417
|
+
target?: ECSStateBlockRequestLatest
|
|
418
|
+
): ECSStateBlockRequestLatest {
|
|
419
|
+
let message = target ?? this.create(),
|
|
420
|
+
end = reader.pos + length;
|
|
421
|
+
while (reader.pos < end) {
|
|
422
|
+
let [fieldNo, wireType] = reader.tag();
|
|
423
|
+
switch (fieldNo) {
|
|
424
|
+
case /* string worldAddress */ 1:
|
|
425
|
+
message.worldAddress = reader.string();
|
|
426
|
+
break;
|
|
427
|
+
default:
|
|
428
|
+
let u = options.readUnknownField;
|
|
429
|
+
if (u === "throw")
|
|
430
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
431
|
+
let d = reader.skip(wireType);
|
|
432
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return message;
|
|
436
|
+
}
|
|
437
|
+
internalBinaryWrite(
|
|
438
|
+
message: ECSStateBlockRequestLatest,
|
|
439
|
+
writer: IBinaryWriter,
|
|
440
|
+
options: BinaryWriteOptions
|
|
441
|
+
): IBinaryWriter {
|
|
442
|
+
/* string worldAddress = 1; */
|
|
443
|
+
if (message.worldAddress !== "") writer.tag(1, WireType.LengthDelimited).string(message.worldAddress);
|
|
444
|
+
let u = options.writeUnknownFields;
|
|
445
|
+
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
446
|
+
return writer;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* @generated MessageType for protobuf message ecssnapshot.ECSStateBlockRequestLatest
|
|
451
|
+
*/
|
|
452
|
+
export const ECSStateBlockRequestLatest = new ECSStateBlockRequestLatest$Type();
|
|
453
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
454
|
+
class ECSStateRequestAtBlock$Type extends MessageType<ECSStateRequestAtBlock> {
|
|
455
|
+
constructor() {
|
|
456
|
+
super("ecssnapshot.ECSStateRequestAtBlock", [
|
|
457
|
+
{ no: 1, name: "blockNumber", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
458
|
+
]);
|
|
459
|
+
}
|
|
460
|
+
create(value?: PartialMessage<ECSStateRequestAtBlock>): ECSStateRequestAtBlock {
|
|
461
|
+
const message = { blockNumber: 0n };
|
|
462
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
463
|
+
if (value !== undefined) reflectionMergePartial<ECSStateRequestAtBlock>(this, message, value);
|
|
464
|
+
return message;
|
|
465
|
+
}
|
|
466
|
+
internalBinaryRead(
|
|
467
|
+
reader: IBinaryReader,
|
|
468
|
+
length: number,
|
|
469
|
+
options: BinaryReadOptions,
|
|
470
|
+
target?: ECSStateRequestAtBlock
|
|
471
|
+
): ECSStateRequestAtBlock {
|
|
472
|
+
let message = target ?? this.create(),
|
|
473
|
+
end = reader.pos + length;
|
|
474
|
+
while (reader.pos < end) {
|
|
475
|
+
let [fieldNo, wireType] = reader.tag();
|
|
476
|
+
switch (fieldNo) {
|
|
477
|
+
case /* uint64 blockNumber */ 1:
|
|
478
|
+
message.blockNumber = reader.uint64().toBigInt();
|
|
479
|
+
break;
|
|
480
|
+
default:
|
|
481
|
+
let u = options.readUnknownField;
|
|
482
|
+
if (u === "throw")
|
|
483
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
484
|
+
let d = reader.skip(wireType);
|
|
485
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return message;
|
|
489
|
+
}
|
|
490
|
+
internalBinaryWrite(
|
|
491
|
+
message: ECSStateRequestAtBlock,
|
|
492
|
+
writer: IBinaryWriter,
|
|
493
|
+
options: BinaryWriteOptions
|
|
494
|
+
): IBinaryWriter {
|
|
495
|
+
/* uint64 blockNumber = 1; */
|
|
496
|
+
if (message.blockNumber !== 0n) writer.tag(1, WireType.Varint).uint64(message.blockNumber);
|
|
497
|
+
let u = options.writeUnknownFields;
|
|
498
|
+
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
499
|
+
return writer;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* @generated MessageType for protobuf message ecssnapshot.ECSStateRequestAtBlock
|
|
504
|
+
*/
|
|
505
|
+
export const ECSStateRequestAtBlock = new ECSStateRequestAtBlock$Type();
|
|
506
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
507
|
+
class WorldsRequest$Type extends MessageType<WorldsRequest> {
|
|
508
|
+
constructor() {
|
|
509
|
+
super("ecssnapshot.WorldsRequest", []);
|
|
510
|
+
}
|
|
511
|
+
create(value?: PartialMessage<WorldsRequest>): WorldsRequest {
|
|
512
|
+
const message = {};
|
|
513
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
514
|
+
if (value !== undefined) reflectionMergePartial<WorldsRequest>(this, message, value);
|
|
515
|
+
return message;
|
|
516
|
+
}
|
|
517
|
+
internalBinaryRead(
|
|
518
|
+
reader: IBinaryReader,
|
|
519
|
+
length: number,
|
|
520
|
+
options: BinaryReadOptions,
|
|
521
|
+
target?: WorldsRequest
|
|
522
|
+
): WorldsRequest {
|
|
523
|
+
return target ?? this.create();
|
|
524
|
+
}
|
|
525
|
+
internalBinaryWrite(message: WorldsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
526
|
+
let u = options.writeUnknownFields;
|
|
527
|
+
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
528
|
+
return writer;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* @generated MessageType for protobuf message ecssnapshot.WorldsRequest
|
|
533
|
+
*/
|
|
534
|
+
export const WorldsRequest = new WorldsRequest$Type();
|
|
535
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
536
|
+
class ECSStateReply$Type extends MessageType<ECSStateReply> {
|
|
537
|
+
constructor() {
|
|
538
|
+
super("ecssnapshot.ECSStateReply", [
|
|
539
|
+
{ no: 1, name: "state", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ECSState },
|
|
540
|
+
{ no: 2, name: "stateComponents", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
541
|
+
{ no: 3, name: "stateEntities", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
542
|
+
{ no: 4, name: "stateHash", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
543
|
+
{ no: 5, name: "blockNumber", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
544
|
+
]);
|
|
545
|
+
}
|
|
546
|
+
create(value?: PartialMessage<ECSStateReply>): ECSStateReply {
|
|
547
|
+
const message = { state: [], stateComponents: [], stateEntities: [], stateHash: "", blockNumber: 0 };
|
|
548
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
549
|
+
if (value !== undefined) reflectionMergePartial<ECSStateReply>(this, message, value);
|
|
550
|
+
return message;
|
|
551
|
+
}
|
|
552
|
+
internalBinaryRead(
|
|
553
|
+
reader: IBinaryReader,
|
|
554
|
+
length: number,
|
|
555
|
+
options: BinaryReadOptions,
|
|
556
|
+
target?: ECSStateReply
|
|
557
|
+
): ECSStateReply {
|
|
558
|
+
let message = target ?? this.create(),
|
|
559
|
+
end = reader.pos + length;
|
|
560
|
+
while (reader.pos < end) {
|
|
561
|
+
let [fieldNo, wireType] = reader.tag();
|
|
562
|
+
switch (fieldNo) {
|
|
563
|
+
case /* repeated ecssnapshot.ECSState state */ 1:
|
|
564
|
+
message.state.push(ECSState.internalBinaryRead(reader, reader.uint32(), options));
|
|
565
|
+
break;
|
|
566
|
+
case /* repeated string stateComponents */ 2:
|
|
567
|
+
message.stateComponents.push(reader.string());
|
|
568
|
+
break;
|
|
569
|
+
case /* repeated string stateEntities */ 3:
|
|
570
|
+
message.stateEntities.push(reader.string());
|
|
571
|
+
break;
|
|
572
|
+
case /* string stateHash */ 4:
|
|
573
|
+
message.stateHash = reader.string();
|
|
574
|
+
break;
|
|
575
|
+
case /* uint32 blockNumber */ 5:
|
|
576
|
+
message.blockNumber = reader.uint32();
|
|
577
|
+
break;
|
|
578
|
+
default:
|
|
579
|
+
let u = options.readUnknownField;
|
|
580
|
+
if (u === "throw")
|
|
581
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
582
|
+
let d = reader.skip(wireType);
|
|
583
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
return message;
|
|
587
|
+
}
|
|
588
|
+
internalBinaryWrite(message: ECSStateReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
589
|
+
/* repeated ecssnapshot.ECSState state = 1; */
|
|
590
|
+
for (let i = 0; i < message.state.length; i++)
|
|
591
|
+
ECSState.internalBinaryWrite(message.state[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
592
|
+
/* repeated string stateComponents = 2; */
|
|
593
|
+
for (let i = 0; i < message.stateComponents.length; i++)
|
|
594
|
+
writer.tag(2, WireType.LengthDelimited).string(message.stateComponents[i]);
|
|
595
|
+
/* repeated string stateEntities = 3; */
|
|
596
|
+
for (let i = 0; i < message.stateEntities.length; i++)
|
|
597
|
+
writer.tag(3, WireType.LengthDelimited).string(message.stateEntities[i]);
|
|
598
|
+
/* string stateHash = 4; */
|
|
599
|
+
if (message.stateHash !== "") writer.tag(4, WireType.LengthDelimited).string(message.stateHash);
|
|
600
|
+
/* uint32 blockNumber = 5; */
|
|
601
|
+
if (message.blockNumber !== 0) writer.tag(5, WireType.Varint).uint32(message.blockNumber);
|
|
602
|
+
let u = options.writeUnknownFields;
|
|
603
|
+
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
604
|
+
return writer;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* @generated MessageType for protobuf message ecssnapshot.ECSStateReply
|
|
609
|
+
*/
|
|
610
|
+
export const ECSStateReply = new ECSStateReply$Type();
|
|
611
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
612
|
+
class ECSStateBlockReply$Type extends MessageType<ECSStateBlockReply> {
|
|
613
|
+
constructor() {
|
|
614
|
+
super("ecssnapshot.ECSStateBlockReply", [
|
|
615
|
+
{ no: 1, name: "blockNumber", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
616
|
+
]);
|
|
617
|
+
}
|
|
618
|
+
create(value?: PartialMessage<ECSStateBlockReply>): ECSStateBlockReply {
|
|
619
|
+
const message = { blockNumber: 0 };
|
|
620
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
621
|
+
if (value !== undefined) reflectionMergePartial<ECSStateBlockReply>(this, message, value);
|
|
622
|
+
return message;
|
|
623
|
+
}
|
|
624
|
+
internalBinaryRead(
|
|
625
|
+
reader: IBinaryReader,
|
|
626
|
+
length: number,
|
|
627
|
+
options: BinaryReadOptions,
|
|
628
|
+
target?: ECSStateBlockReply
|
|
629
|
+
): ECSStateBlockReply {
|
|
630
|
+
let message = target ?? this.create(),
|
|
631
|
+
end = reader.pos + length;
|
|
632
|
+
while (reader.pos < end) {
|
|
633
|
+
let [fieldNo, wireType] = reader.tag();
|
|
634
|
+
switch (fieldNo) {
|
|
635
|
+
case /* uint32 blockNumber */ 1:
|
|
636
|
+
message.blockNumber = reader.uint32();
|
|
637
|
+
break;
|
|
638
|
+
default:
|
|
639
|
+
let u = options.readUnknownField;
|
|
640
|
+
if (u === "throw")
|
|
641
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
642
|
+
let d = reader.skip(wireType);
|
|
643
|
+
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return message;
|
|
647
|
+
}
|
|
648
|
+
internalBinaryWrite(message: ECSStateBlockReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
649
|
+
/* uint32 blockNumber = 1; */
|
|
650
|
+
if (message.blockNumber !== 0) writer.tag(1, WireType.Varint).uint32(message.blockNumber);
|
|
651
|
+
let u = options.writeUnknownFields;
|
|
652
|
+
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
653
|
+
return writer;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* @generated MessageType for protobuf message ecssnapshot.ECSStateBlockReply
|
|
658
|
+
*/
|
|
659
|
+
export const ECSStateBlockReply = new ECSStateBlockReply$Type();
|
|
660
|
+
/**
|
|
661
|
+
* @generated ServiceType for protobuf service ecssnapshot.ECSStateSnapshotService
|
|
662
|
+
*/
|
|
663
|
+
export const ECSStateSnapshotService = new ServiceType("ecssnapshot.ECSStateSnapshotService", [
|
|
664
|
+
{ name: "GetStateLatest", options: {}, I: ECSStateRequestLatest, O: ECSStateReply },
|
|
665
|
+
{ name: "GetStateLatestStream", serverStreaming: true, options: {}, I: ECSStateRequestLatest, O: ECSStateReply },
|
|
666
|
+
{ name: "GetStateBlockLatest", options: {}, I: ECSStateBlockRequestLatest, O: ECSStateBlockReply },
|
|
667
|
+
{ name: "GetStateAtBlock", options: {}, I: ECSStateRequestAtBlock, O: ECSStateReply },
|
|
668
|
+
{ name: "GetWorlds", options: {}, I: WorldsRequest, O: Worlds },
|
|
669
|
+
]);
|