@latticexyz/services 1.4.1 → 1.5.1

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.
@@ -1,669 +1,624 @@
1
1
  /* eslint-disable */
2
- // @generated by protobuf-ts 2.8.1 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
- */
2
+ import Long from "long";
3
+ import { CallContext, CallOptions } from "nice-grpc-common";
4
+ import _m0 from "protobufjs/minimal";
5
+
6
+ export const protobufPackage = "ecssnapshot";
7
+
19
8
  export interface ECSState {
20
- /**
21
- * @generated from protobuf field: uint32 component_id_idx = 1;
22
- */
23
9
  componentIdIdx: number;
24
- /**
25
- * @generated from protobuf field: uint32 entity_id_idx = 2;
26
- */
27
10
  entityIdIdx: number;
28
- /**
29
- * @generated from protobuf field: bytes value = 3;
30
- */
31
11
  value: Uint8Array;
32
12
  }
33
- /**
34
- * @generated from protobuf message ecssnapshot.ECSStateSnapshot
35
- */
13
+
36
14
  export interface ECSStateSnapshot {
37
- /**
38
- * @generated from protobuf field: repeated ecssnapshot.ECSState state = 1;
39
- */
40
15
  state: ECSState[];
41
- /**
42
- * @generated from protobuf field: repeated string stateComponents = 2;
43
- */
44
16
  stateComponents: string[];
45
- /**
46
- * @generated from protobuf field: repeated string stateEntities = 3;
47
- */
48
17
  stateEntities: string[];
49
- /**
50
- * @generated from protobuf field: string stateHash = 4;
51
- */
52
18
  stateHash: string;
53
- /**
54
- * @generated from protobuf field: uint32 startBlockNumber = 5;
55
- */
56
19
  startBlockNumber: number;
57
- /**
58
- * @generated from protobuf field: uint32 endBlockNumber = 6;
59
- */
60
20
  endBlockNumber: number;
61
- /**
62
- * @generated from protobuf field: string worldAddress = 7;
63
- */
64
21
  worldAddress: string;
65
22
  }
66
- /**
67
- * @generated from protobuf message ecssnapshot.Worlds
68
- */
23
+
69
24
  export interface Worlds {
70
- /**
71
- * @generated from protobuf field: repeated string worldAddress = 1;
72
- */
73
25
  worldAddress: string[];
74
26
  }
75
- /**
76
- * The request message for the latest ECS state.
77
- *
78
- * @generated from protobuf message ecssnapshot.ECSStateRequestLatest
79
- */
27
+
28
+ /** The request message for the latest ECS state. */
80
29
  export interface ECSStateRequestLatest {
81
- /**
82
- * @generated from protobuf field: string worldAddress = 1;
83
- */
84
30
  worldAddress: string;
85
31
  }
86
- /**
87
- * The request message for the latest block based on latest ECS state.
88
- *
89
- * @generated from protobuf message ecssnapshot.ECSStateBlockRequestLatest
90
- */
32
+
33
+ /** The request message for the latest block based on latest ECS state. */
91
34
  export interface ECSStateBlockRequestLatest {
92
- /**
93
- * @generated from protobuf field: string worldAddress = 1;
94
- */
95
35
  worldAddress: string;
96
36
  }
97
- /**
98
- * The request message for the ECS state given a block number.
99
- *
100
- * @generated from protobuf message ecssnapshot.ECSStateRequestAtBlock
101
- */
37
+
38
+ /** The request message for the ECS state given a block number. */
102
39
  export interface ECSStateRequestAtBlock {
103
- /**
104
- * @generated from protobuf field: uint64 blockNumber = 1;
105
- */
106
- blockNumber: bigint;
40
+ blockNumber: number;
107
41
  }
108
- /**
109
- * The request message for all worlds.
110
- *
111
- * @generated from protobuf message ecssnapshot.WorldsRequest
112
- */
42
+
43
+ /** The request message for all worlds. */
113
44
  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
- */
45
+
46
+ /** The response message containing the current state, hash of that state, and the block number of that state. */
119
47
  export interface ECSStateReply {
120
- /**
121
- * @generated from protobuf field: repeated ecssnapshot.ECSState state = 1;
122
- */
123
48
  state: ECSState[];
124
- /**
125
- * @generated from protobuf field: repeated string stateComponents = 2;
126
- */
127
49
  stateComponents: string[];
128
- /**
129
- * @generated from protobuf field: repeated string stateEntities = 3;
130
- */
131
50
  stateEntities: string[];
132
- /**
133
- * @generated from protobuf field: string stateHash = 4;
134
- */
135
51
  stateHash: string;
136
- /**
137
- * @generated from protobuf field: uint32 blockNumber = 5;
138
- */
139
52
  blockNumber: number;
140
53
  }
141
- /**
142
- * @generated from protobuf message ecssnapshot.ECSStateBlockReply
143
- */
54
+
144
55
  export interface ECSStateBlockReply {
145
- /**
146
- * @generated from protobuf field: uint32 blockNumber = 1;
147
- */
148
56
  blockNumber: number;
149
57
  }
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;
58
+
59
+ function createBaseECSState(): ECSState {
60
+ return { componentIdIdx: 0, entityIdIdx: 0, value: new Uint8Array() };
61
+ }
62
+
63
+ export const ECSState = {
64
+ encode(message: ECSState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
65
+ if (message.componentIdIdx !== 0) {
66
+ writer.uint32(8).uint32(message.componentIdIdx);
67
+ }
68
+ if (message.entityIdIdx !== 0) {
69
+ writer.uint32(16).uint32(message.entityIdIdx);
70
+ }
71
+ if (message.value.length !== 0) {
72
+ writer.uint32(26).bytes(message.value);
73
+ }
74
+ return writer;
75
+ },
76
+
77
+ decode(input: _m0.Reader | Uint8Array, length?: number): ECSState {
78
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
79
+ let end = length === undefined ? reader.len : reader.pos + length;
80
+ const message = createBaseECSState();
168
81
  while (reader.pos < end) {
169
- let [fieldNo, wireType] = reader.tag();
170
- switch (fieldNo) {
171
- case /* uint32 component_id_idx */ 1:
82
+ const tag = reader.uint32();
83
+ switch (tag >>> 3) {
84
+ case 1:
172
85
  message.componentIdIdx = reader.uint32();
173
86
  break;
174
- case /* uint32 entity_id_idx */ 2:
87
+ case 2:
175
88
  message.entityIdIdx = reader.uint32();
176
89
  break;
177
- case /* bytes value */ 3:
90
+ case 3:
178
91
  message.value = reader.bytes();
179
92
  break;
180
93
  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);
94
+ reader.skipType(tag & 7);
95
+ break;
186
96
  }
187
97
  }
188
98
  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);
99
+ },
100
+
101
+ fromPartial(object: DeepPartial<ECSState>): ECSState {
102
+ const message = createBaseECSState();
103
+ message.componentIdIdx = object.componentIdIdx ?? 0;
104
+ message.entityIdIdx = object.entityIdIdx ?? 0;
105
+ message.value = object.value ?? new Uint8Array();
231
106
  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;
107
+ },
108
+ };
109
+
110
+ function createBaseECSStateSnapshot(): ECSStateSnapshot {
111
+ return {
112
+ state: [],
113
+ stateComponents: [],
114
+ stateEntities: [],
115
+ stateHash: "",
116
+ startBlockNumber: 0,
117
+ endBlockNumber: 0,
118
+ worldAddress: "",
119
+ };
120
+ }
121
+
122
+ export const ECSStateSnapshot = {
123
+ encode(message: ECSStateSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
124
+ for (const v of message.state) {
125
+ ECSState.encode(v!, writer.uint32(10).fork()).ldelim();
126
+ }
127
+ for (const v of message.stateComponents) {
128
+ writer.uint32(18).string(v!);
129
+ }
130
+ for (const v of message.stateEntities) {
131
+ writer.uint32(26).string(v!);
132
+ }
133
+ if (message.stateHash !== "") {
134
+ writer.uint32(34).string(message.stateHash);
135
+ }
136
+ if (message.startBlockNumber !== 0) {
137
+ writer.uint32(40).uint32(message.startBlockNumber);
138
+ }
139
+ if (message.endBlockNumber !== 0) {
140
+ writer.uint32(48).uint32(message.endBlockNumber);
141
+ }
142
+ if (message.worldAddress !== "") {
143
+ writer.uint32(58).string(message.worldAddress);
144
+ }
145
+ return writer;
146
+ },
147
+
148
+ decode(input: _m0.Reader | Uint8Array, length?: number): ECSStateSnapshot {
149
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
150
+ let end = length === undefined ? reader.len : reader.pos + length;
151
+ const message = createBaseECSStateSnapshot();
241
152
  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));
153
+ const tag = reader.uint32();
154
+ switch (tag >>> 3) {
155
+ case 1:
156
+ message.state.push(ECSState.decode(reader, reader.uint32()));
246
157
  break;
247
- case /* repeated string stateComponents */ 2:
158
+ case 2:
248
159
  message.stateComponents.push(reader.string());
249
160
  break;
250
- case /* repeated string stateEntities */ 3:
161
+ case 3:
251
162
  message.stateEntities.push(reader.string());
252
163
  break;
253
- case /* string stateHash */ 4:
164
+ case 4:
254
165
  message.stateHash = reader.string();
255
166
  break;
256
- case /* uint32 startBlockNumber */ 5:
167
+ case 5:
257
168
  message.startBlockNumber = reader.uint32();
258
169
  break;
259
- case /* uint32 endBlockNumber */ 6:
170
+ case 6:
260
171
  message.endBlockNumber = reader.uint32();
261
172
  break;
262
- case /* string worldAddress */ 7:
173
+ case 7:
263
174
  message.worldAddress = reader.string();
264
175
  break;
265
176
  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);
177
+ reader.skipType(tag & 7);
178
+ break;
271
179
  }
272
180
  }
273
181
  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);
182
+ },
183
+
184
+ fromPartial(object: DeepPartial<ECSStateSnapshot>): ECSStateSnapshot {
185
+ const message = createBaseECSStateSnapshot();
186
+ message.state = object.state?.map((e) => ECSState.fromPartial(e)) || [];
187
+ message.stateComponents = object.stateComponents?.map((e) => e) || [];
188
+ message.stateEntities = object.stateEntities?.map((e) => e) || [];
189
+ message.stateHash = object.stateHash ?? "";
190
+ message.startBlockNumber = object.startBlockNumber ?? 0;
191
+ message.endBlockNumber = object.endBlockNumber ?? 0;
192
+ message.worldAddress = object.worldAddress ?? "";
313
193
  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;
194
+ },
195
+ };
196
+
197
+ function createBaseWorlds(): Worlds {
198
+ return { worldAddress: [] };
199
+ }
200
+
201
+ export const Worlds = {
202
+ encode(message: Worlds, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
203
+ for (const v of message.worldAddress) {
204
+ writer.uint32(10).string(v!);
205
+ }
206
+ return writer;
207
+ },
208
+
209
+ decode(input: _m0.Reader | Uint8Array, length?: number): Worlds {
210
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
211
+ let end = length === undefined ? reader.len : reader.pos + length;
212
+ const message = createBaseWorlds();
318
213
  while (reader.pos < end) {
319
- let [fieldNo, wireType] = reader.tag();
320
- switch (fieldNo) {
321
- case /* repeated string worldAddress */ 1:
214
+ const tag = reader.uint32();
215
+ switch (tag >>> 3) {
216
+ case 1:
322
217
  message.worldAddress.push(reader.string());
323
218
  break;
324
219
  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);
220
+ reader.skipType(tag & 7);
221
+ break;
330
222
  }
331
223
  }
332
224
  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);
225
+ },
226
+
227
+ fromPartial(object: DeepPartial<Worlds>): Worlds {
228
+ const message = createBaseWorlds();
229
+ message.worldAddress = object.worldAddress?.map((e) => e) || [];
358
230
  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;
231
+ },
232
+ };
233
+
234
+ function createBaseECSStateRequestLatest(): ECSStateRequestLatest {
235
+ return { worldAddress: "" };
236
+ }
237
+
238
+ export const ECSStateRequestLatest = {
239
+ encode(message: ECSStateRequestLatest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
240
+ if (message.worldAddress !== "") {
241
+ writer.uint32(10).string(message.worldAddress);
242
+ }
243
+ return writer;
244
+ },
245
+
246
+ decode(input: _m0.Reader | Uint8Array, length?: number): ECSStateRequestLatest {
247
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
248
+ let end = length === undefined ? reader.len : reader.pos + length;
249
+ const message = createBaseECSStateRequestLatest();
368
250
  while (reader.pos < end) {
369
- let [fieldNo, wireType] = reader.tag();
370
- switch (fieldNo) {
371
- case /* string worldAddress */ 1:
251
+ const tag = reader.uint32();
252
+ switch (tag >>> 3) {
253
+ case 1:
372
254
  message.worldAddress = reader.string();
373
255
  break;
374
256
  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);
257
+ reader.skipType(tag & 7);
258
+ break;
380
259
  }
381
260
  }
382
261
  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);
262
+ },
263
+
264
+ fromPartial(object: DeepPartial<ECSStateRequestLatest>): ECSStateRequestLatest {
265
+ const message = createBaseECSStateRequestLatest();
266
+ message.worldAddress = object.worldAddress ?? "";
411
267
  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;
268
+ },
269
+ };
270
+
271
+ function createBaseECSStateBlockRequestLatest(): ECSStateBlockRequestLatest {
272
+ return { worldAddress: "" };
273
+ }
274
+
275
+ export const ECSStateBlockRequestLatest = {
276
+ encode(message: ECSStateBlockRequestLatest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
277
+ if (message.worldAddress !== "") {
278
+ writer.uint32(10).string(message.worldAddress);
279
+ }
280
+ return writer;
281
+ },
282
+
283
+ decode(input: _m0.Reader | Uint8Array, length?: number): ECSStateBlockRequestLatest {
284
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
285
+ let end = length === undefined ? reader.len : reader.pos + length;
286
+ const message = createBaseECSStateBlockRequestLatest();
421
287
  while (reader.pos < end) {
422
- let [fieldNo, wireType] = reader.tag();
423
- switch (fieldNo) {
424
- case /* string worldAddress */ 1:
288
+ const tag = reader.uint32();
289
+ switch (tag >>> 3) {
290
+ case 1:
425
291
  message.worldAddress = reader.string();
426
292
  break;
427
293
  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);
294
+ reader.skipType(tag & 7);
295
+ break;
433
296
  }
434
297
  }
435
298
  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);
299
+ },
300
+
301
+ fromPartial(object: DeepPartial<ECSStateBlockRequestLatest>): ECSStateBlockRequestLatest {
302
+ const message = createBaseECSStateBlockRequestLatest();
303
+ message.worldAddress = object.worldAddress ?? "";
464
304
  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;
305
+ },
306
+ };
307
+
308
+ function createBaseECSStateRequestAtBlock(): ECSStateRequestAtBlock {
309
+ return { blockNumber: 0 };
310
+ }
311
+
312
+ export const ECSStateRequestAtBlock = {
313
+ encode(message: ECSStateRequestAtBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
314
+ if (message.blockNumber !== 0) {
315
+ writer.uint32(8).uint64(message.blockNumber);
316
+ }
317
+ return writer;
318
+ },
319
+
320
+ decode(input: _m0.Reader | Uint8Array, length?: number): ECSStateRequestAtBlock {
321
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
322
+ let end = length === undefined ? reader.len : reader.pos + length;
323
+ const message = createBaseECSStateRequestAtBlock();
474
324
  while (reader.pos < end) {
475
- let [fieldNo, wireType] = reader.tag();
476
- switch (fieldNo) {
477
- case /* uint64 blockNumber */ 1:
478
- message.blockNumber = reader.uint64().toBigInt();
325
+ const tag = reader.uint32();
326
+ switch (tag >>> 3) {
327
+ case 1:
328
+ message.blockNumber = longToNumber(reader.uint64() as Long);
479
329
  break;
480
330
  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);
331
+ reader.skipType(tag & 7);
332
+ break;
486
333
  }
487
334
  }
488
335
  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);
336
+ },
337
+
338
+ fromPartial(object: DeepPartial<ECSStateRequestAtBlock>): ECSStateRequestAtBlock {
339
+ const message = createBaseECSStateRequestAtBlock();
340
+ message.blockNumber = object.blockNumber ?? 0;
515
341
  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
- }
342
+ },
343
+ };
344
+
345
+ function createBaseWorldsRequest(): WorldsRequest {
346
+ return {};
530
347
  }
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);
348
+
349
+ export const WorldsRequest = {
350
+ encode(_: WorldsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
351
+ return writer;
352
+ },
353
+
354
+ decode(input: _m0.Reader | Uint8Array, length?: number): WorldsRequest {
355
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
356
+ let end = length === undefined ? reader.len : reader.pos + length;
357
+ const message = createBaseWorldsRequest();
358
+ while (reader.pos < end) {
359
+ const tag = reader.uint32();
360
+ switch (tag >>> 3) {
361
+ default:
362
+ reader.skipType(tag & 7);
363
+ break;
364
+ }
365
+ }
550
366
  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;
367
+ },
368
+
369
+ fromPartial(_: DeepPartial<WorldsRequest>): WorldsRequest {
370
+ const message = createBaseWorldsRequest();
371
+ return message;
372
+ },
373
+ };
374
+
375
+ function createBaseECSStateReply(): ECSStateReply {
376
+ return { state: [], stateComponents: [], stateEntities: [], stateHash: "", blockNumber: 0 };
377
+ }
378
+
379
+ export const ECSStateReply = {
380
+ encode(message: ECSStateReply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
381
+ for (const v of message.state) {
382
+ ECSState.encode(v!, writer.uint32(10).fork()).ldelim();
383
+ }
384
+ for (const v of message.stateComponents) {
385
+ writer.uint32(18).string(v!);
386
+ }
387
+ for (const v of message.stateEntities) {
388
+ writer.uint32(26).string(v!);
389
+ }
390
+ if (message.stateHash !== "") {
391
+ writer.uint32(34).string(message.stateHash);
392
+ }
393
+ if (message.blockNumber !== 0) {
394
+ writer.uint32(40).uint32(message.blockNumber);
395
+ }
396
+ return writer;
397
+ },
398
+
399
+ decode(input: _m0.Reader | Uint8Array, length?: number): ECSStateReply {
400
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
401
+ let end = length === undefined ? reader.len : reader.pos + length;
402
+ const message = createBaseECSStateReply();
560
403
  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));
404
+ const tag = reader.uint32();
405
+ switch (tag >>> 3) {
406
+ case 1:
407
+ message.state.push(ECSState.decode(reader, reader.uint32()));
565
408
  break;
566
- case /* repeated string stateComponents */ 2:
409
+ case 2:
567
410
  message.stateComponents.push(reader.string());
568
411
  break;
569
- case /* repeated string stateEntities */ 3:
412
+ case 3:
570
413
  message.stateEntities.push(reader.string());
571
414
  break;
572
- case /* string stateHash */ 4:
415
+ case 4:
573
416
  message.stateHash = reader.string();
574
417
  break;
575
- case /* uint32 blockNumber */ 5:
418
+ case 5:
576
419
  message.blockNumber = reader.uint32();
577
420
  break;
578
421
  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);
422
+ reader.skipType(tag & 7);
423
+ break;
584
424
  }
585
425
  }
586
426
  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);
427
+ },
428
+
429
+ fromPartial(object: DeepPartial<ECSStateReply>): ECSStateReply {
430
+ const message = createBaseECSStateReply();
431
+ message.state = object.state?.map((e) => ECSState.fromPartial(e)) || [];
432
+ message.stateComponents = object.stateComponents?.map((e) => e) || [];
433
+ message.stateEntities = object.stateEntities?.map((e) => e) || [];
434
+ message.stateHash = object.stateHash ?? "";
435
+ message.blockNumber = object.blockNumber ?? 0;
622
436
  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;
437
+ },
438
+ };
439
+
440
+ function createBaseECSStateBlockReply(): ECSStateBlockReply {
441
+ return { blockNumber: 0 };
442
+ }
443
+
444
+ export const ECSStateBlockReply = {
445
+ encode(message: ECSStateBlockReply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
446
+ if (message.blockNumber !== 0) {
447
+ writer.uint32(8).uint32(message.blockNumber);
448
+ }
449
+ return writer;
450
+ },
451
+
452
+ decode(input: _m0.Reader | Uint8Array, length?: number): ECSStateBlockReply {
453
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
454
+ let end = length === undefined ? reader.len : reader.pos + length;
455
+ const message = createBaseECSStateBlockReply();
632
456
  while (reader.pos < end) {
633
- let [fieldNo, wireType] = reader.tag();
634
- switch (fieldNo) {
635
- case /* uint32 blockNumber */ 1:
457
+ const tag = reader.uint32();
458
+ switch (tag >>> 3) {
459
+ case 1:
636
460
  message.blockNumber = reader.uint32();
637
461
  break;
638
462
  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);
463
+ reader.skipType(tag & 7);
464
+ break;
644
465
  }
645
466
  }
646
467
  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
- }
468
+ },
469
+
470
+ fromPartial(object: DeepPartial<ECSStateBlockReply>): ECSStateBlockReply {
471
+ const message = createBaseECSStateBlockReply();
472
+ message.blockNumber = object.blockNumber ?? 0;
473
+ return message;
474
+ },
475
+ };
476
+
477
+ /** The Snapshot Service definition. */
478
+ export type ECSStateSnapshotServiceDefinition = typeof ECSStateSnapshotServiceDefinition;
479
+ export const ECSStateSnapshotServiceDefinition = {
480
+ name: "ECSStateSnapshotService",
481
+ fullName: "ecssnapshot.ECSStateSnapshotService",
482
+ methods: {
483
+ /** Requests the latest ECS state. */
484
+ getStateLatest: {
485
+ name: "GetStateLatest",
486
+ requestType: ECSStateRequestLatest,
487
+ requestStream: false,
488
+ responseType: ECSStateReply,
489
+ responseStream: false,
490
+ options: {},
491
+ },
492
+ /** Requests the latest ECS state in stream format, which will chunk the state. */
493
+ getStateLatestStream: {
494
+ name: "GetStateLatestStream",
495
+ requestType: ECSStateRequestLatest,
496
+ requestStream: false,
497
+ responseType: ECSStateReply,
498
+ responseStream: true,
499
+ options: {},
500
+ },
501
+ /** Requests the latest block number based on the latest ECS state. */
502
+ getStateBlockLatest: {
503
+ name: "GetStateBlockLatest",
504
+ requestType: ECSStateBlockRequestLatest,
505
+ requestStream: false,
506
+ responseType: ECSStateBlockReply,
507
+ responseStream: false,
508
+ options: {},
509
+ },
510
+ /** Requests the ECS state at specific block. */
511
+ getStateAtBlock: {
512
+ name: "GetStateAtBlock",
513
+ requestType: ECSStateRequestAtBlock,
514
+ requestStream: false,
515
+ responseType: ECSStateReply,
516
+ responseStream: false,
517
+ options: {},
518
+ },
519
+ /** Requests a list of known worlds based on chain state. */
520
+ getWorlds: {
521
+ name: "GetWorlds",
522
+ requestType: WorldsRequest,
523
+ requestStream: false,
524
+ responseType: Worlds,
525
+ responseStream: false,
526
+ options: {},
527
+ },
528
+ },
529
+ } as const;
530
+
531
+ export interface ECSStateSnapshotServiceServiceImplementation<CallContextExt = {}> {
532
+ /** Requests the latest ECS state. */
533
+ getStateLatest(
534
+ request: ECSStateRequestLatest,
535
+ context: CallContext & CallContextExt
536
+ ): Promise<DeepPartial<ECSStateReply>>;
537
+ /** Requests the latest ECS state in stream format, which will chunk the state. */
538
+ getStateLatestStream(
539
+ request: ECSStateRequestLatest,
540
+ context: CallContext & CallContextExt
541
+ ): ServerStreamingMethodResult<DeepPartial<ECSStateReply>>;
542
+ /** Requests the latest block number based on the latest ECS state. */
543
+ getStateBlockLatest(
544
+ request: ECSStateBlockRequestLatest,
545
+ context: CallContext & CallContextExt
546
+ ): Promise<DeepPartial<ECSStateBlockReply>>;
547
+ /** Requests the ECS state at specific block. */
548
+ getStateAtBlock(
549
+ request: ECSStateRequestAtBlock,
550
+ context: CallContext & CallContextExt
551
+ ): Promise<DeepPartial<ECSStateReply>>;
552
+ /** Requests a list of known worlds based on chain state. */
553
+ getWorlds(request: WorldsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Worlds>>;
554
+ }
555
+
556
+ export interface ECSStateSnapshotServiceClient<CallOptionsExt = {}> {
557
+ /** Requests the latest ECS state. */
558
+ getStateLatest(
559
+ request: DeepPartial<ECSStateRequestLatest>,
560
+ options?: CallOptions & CallOptionsExt
561
+ ): Promise<ECSStateReply>;
562
+ /** Requests the latest ECS state in stream format, which will chunk the state. */
563
+ getStateLatestStream(
564
+ request: DeepPartial<ECSStateRequestLatest>,
565
+ options?: CallOptions & CallOptionsExt
566
+ ): AsyncIterable<ECSStateReply>;
567
+ /** Requests the latest block number based on the latest ECS state. */
568
+ getStateBlockLatest(
569
+ request: DeepPartial<ECSStateBlockRequestLatest>,
570
+ options?: CallOptions & CallOptionsExt
571
+ ): Promise<ECSStateBlockReply>;
572
+ /** Requests the ECS state at specific block. */
573
+ getStateAtBlock(
574
+ request: DeepPartial<ECSStateRequestAtBlock>,
575
+ options?: CallOptions & CallOptionsExt
576
+ ): Promise<ECSStateReply>;
577
+ /** Requests a list of known worlds based on chain state. */
578
+ getWorlds(request: DeepPartial<WorldsRequest>, options?: CallOptions & CallOptionsExt): Promise<Worlds>;
579
+ }
580
+
581
+ declare var self: any | undefined;
582
+ declare var window: any | undefined;
583
+ declare var global: any | undefined;
584
+ var globalThis: any = (() => {
585
+ if (typeof globalThis !== "undefined") {
586
+ return globalThis;
587
+ }
588
+ if (typeof self !== "undefined") {
589
+ return self;
590
+ }
591
+ if (typeof window !== "undefined") {
592
+ return window;
593
+ }
594
+ if (typeof global !== "undefined") {
595
+ return global;
596
+ }
597
+ throw "Unable to locate global object";
598
+ })();
599
+
600
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
601
+
602
+ export type DeepPartial<T> = T extends Builtin
603
+ ? T
604
+ : T extends Array<infer U>
605
+ ? Array<DeepPartial<U>>
606
+ : T extends ReadonlyArray<infer U>
607
+ ? ReadonlyArray<DeepPartial<U>>
608
+ : T extends {}
609
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
610
+ : Partial<T>;
611
+
612
+ function longToNumber(long: Long): number {
613
+ if (long.gt(Number.MAX_SAFE_INTEGER)) {
614
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
615
+ }
616
+ return long.toNumber();
617
+ }
618
+
619
+ if (_m0.util.Long !== Long) {
620
+ _m0.util.Long = Long as any;
621
+ _m0.configure();
655
622
  }
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
- ]);
623
+
624
+ export type ServerStreamingMethodResult<Response> = { [Symbol.asyncIterator](): AsyncIterator<Response, void> };