@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.
- package/bin/ecs-relay +0 -0
- package/bin/ecs-snapshot +0 -0
- package/bin/ecs-stream +0 -0
- package/bin/faucet +0 -0
- package/package.json +4 -10
- package/protobuf/go/ecs-relay/ecs-relay.pb.go +33 -27
- package/protobuf/go/ecs-relay/ecs-relay_grpc.pb.go +71 -1
- package/protobuf/go/ecs-snapshot/ecs-snapshot.pb.go +1 -1
- package/protobuf/go/ecs-snapshot/ecs-snapshot_grpc.pb.go +1 -1
- package/protobuf/go/ecs-stream/ecs-stream.pb.go +1 -1
- package/protobuf/go/ecs-stream/ecs-stream_grpc.pb.go +1 -1
- package/protobuf/go/faucet/faucet.pb.go +292 -127
- package/protobuf/go/faucet/faucet_grpc.pb.go +73 -1
- package/protobuf/ts/ecs-relay/ecs-relay.ts +562 -535
- package/protobuf/ts/ecs-snapshot/ecs-snapshot.ts +500 -545
- package/protobuf/ts/ecs-stream/ecs-stream.ts +215 -279
- package/protobuf/ts/faucet/faucet.ts +785 -701
- package/protobuf/ts/index.ts +4 -0
- package/protobuf/ts/ecs-relay/ecs-relay.client.ts +0 -191
- package/protobuf/ts/ecs-snapshot/ecs-snapshot.client.ts +0 -134
- package/protobuf/ts/ecs-stream/ecs-stream.client.ts +0 -58
- package/protobuf/ts/faucet/faucet.client.ts +0 -136
|
@@ -1,359 +1,295 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 ecsstream.ECSEvent
|
|
18
|
-
*/
|
|
2
|
+
import { CallContext, CallOptions } from "nice-grpc-common";
|
|
3
|
+
import _m0 from "protobufjs/minimal";
|
|
4
|
+
|
|
5
|
+
export const protobufPackage = "ecsstream";
|
|
6
|
+
|
|
19
7
|
export interface ECSEvent {
|
|
20
|
-
/**
|
|
21
|
-
* @generated from protobuf field: string eventType = 1;
|
|
22
|
-
*/
|
|
23
8
|
eventType: string;
|
|
24
|
-
/**
|
|
25
|
-
* @generated from protobuf field: string componentId = 2;
|
|
26
|
-
*/
|
|
27
9
|
componentId: string;
|
|
28
|
-
/**
|
|
29
|
-
* @generated from protobuf field: string entityId = 3;
|
|
30
|
-
*/
|
|
31
10
|
entityId: string;
|
|
32
|
-
/**
|
|
33
|
-
* @generated from protobuf field: bytes value = 4;
|
|
34
|
-
*/
|
|
35
11
|
value: Uint8Array;
|
|
36
|
-
/**
|
|
37
|
-
* @generated from protobuf field: string tx = 5;
|
|
38
|
-
*/
|
|
39
12
|
tx: string;
|
|
40
13
|
}
|
|
14
|
+
|
|
41
15
|
/**
|
|
42
16
|
* Request to subscribe to an ECSStream. The required parameter is 'worldAddress', while others
|
|
43
17
|
* are opt-in based on which data the client is interested in receiving.
|
|
44
|
-
*
|
|
45
|
-
* @generated from protobuf message ecsstream.ECSStreamBlockBundleRequest
|
|
46
18
|
*/
|
|
47
19
|
export interface ECSStreamBlockBundleRequest {
|
|
48
|
-
/**
|
|
49
|
-
* @generated from protobuf field: string worldAddress = 1;
|
|
50
|
-
*/
|
|
51
20
|
worldAddress: string;
|
|
52
|
-
/**
|
|
53
|
-
* @generated from protobuf field: bool blockNumber = 2;
|
|
54
|
-
*/
|
|
55
21
|
blockNumber: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* @generated from protobuf field: bool blockHash = 3;
|
|
58
|
-
*/
|
|
59
22
|
blockHash: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* @generated from protobuf field: bool blockTimestamp = 4;
|
|
62
|
-
*/
|
|
63
23
|
blockTimestamp: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* @generated from protobuf field: bool transactionsConfirmed = 5;
|
|
66
|
-
*/
|
|
67
24
|
transactionsConfirmed: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* @generated from protobuf field: bool ecsEvents = 6;
|
|
70
|
-
*/
|
|
71
25
|
ecsEvents: boolean;
|
|
72
26
|
}
|
|
27
|
+
|
|
73
28
|
/**
|
|
74
29
|
* ECSStream response. The fields are populated based on the request which must have been sent when
|
|
75
30
|
* starting the subscription.
|
|
76
|
-
*
|
|
77
|
-
* @generated from protobuf message ecsstream.ECSStreamBlockBundleReply
|
|
78
31
|
*/
|
|
79
32
|
export interface ECSStreamBlockBundleReply {
|
|
80
|
-
/**
|
|
81
|
-
* @generated from protobuf field: uint32 blockNumber = 1;
|
|
82
|
-
*/
|
|
83
33
|
blockNumber: number;
|
|
84
|
-
/**
|
|
85
|
-
* @generated from protobuf field: string blockHash = 2;
|
|
86
|
-
*/
|
|
87
34
|
blockHash: string;
|
|
88
|
-
/**
|
|
89
|
-
* @generated from protobuf field: uint32 blockTimestamp = 3;
|
|
90
|
-
*/
|
|
91
35
|
blockTimestamp: number;
|
|
92
|
-
/**
|
|
93
|
-
* @generated from protobuf field: repeated string transactionsConfirmed = 4;
|
|
94
|
-
*/
|
|
95
36
|
transactionsConfirmed: string[];
|
|
96
|
-
/**
|
|
97
|
-
* @generated from protobuf field: repeated ecsstream.ECSEvent ecsEvents = 5;
|
|
98
|
-
*/
|
|
99
37
|
ecsEvents: ECSEvent[];
|
|
100
38
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
39
|
+
|
|
40
|
+
function createBaseECSEvent(): ECSEvent {
|
|
41
|
+
return { eventType: "", componentId: "", entityId: "", value: new Uint8Array(), tx: "" };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const ECSEvent = {
|
|
45
|
+
encode(message: ECSEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
46
|
+
if (message.eventType !== "") {
|
|
47
|
+
writer.uint32(10).string(message.eventType);
|
|
48
|
+
}
|
|
49
|
+
if (message.componentId !== "") {
|
|
50
|
+
writer.uint32(18).string(message.componentId);
|
|
51
|
+
}
|
|
52
|
+
if (message.entityId !== "") {
|
|
53
|
+
writer.uint32(26).string(message.entityId);
|
|
54
|
+
}
|
|
55
|
+
if (message.value.length !== 0) {
|
|
56
|
+
writer.uint32(34).bytes(message.value);
|
|
57
|
+
}
|
|
58
|
+
if (message.tx !== "") {
|
|
59
|
+
writer.uint32(42).string(message.tx);
|
|
60
|
+
}
|
|
61
|
+
return writer;
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ECSEvent {
|
|
65
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
66
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
67
|
+
const message = createBaseECSEvent();
|
|
121
68
|
while (reader.pos < end) {
|
|
122
|
-
|
|
123
|
-
switch (
|
|
124
|
-
case
|
|
69
|
+
const tag = reader.uint32();
|
|
70
|
+
switch (tag >>> 3) {
|
|
71
|
+
case 1:
|
|
125
72
|
message.eventType = reader.string();
|
|
126
73
|
break;
|
|
127
|
-
case
|
|
74
|
+
case 2:
|
|
128
75
|
message.componentId = reader.string();
|
|
129
76
|
break;
|
|
130
|
-
case
|
|
77
|
+
case 3:
|
|
131
78
|
message.entityId = reader.string();
|
|
132
79
|
break;
|
|
133
|
-
case
|
|
80
|
+
case 4:
|
|
134
81
|
message.value = reader.bytes();
|
|
135
82
|
break;
|
|
136
|
-
case
|
|
83
|
+
case 5:
|
|
137
84
|
message.tx = reader.string();
|
|
138
85
|
break;
|
|
139
86
|
default:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
143
|
-
let d = reader.skip(wireType);
|
|
144
|
-
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
87
|
+
reader.skipType(tag & 7);
|
|
88
|
+
break;
|
|
145
89
|
}
|
|
146
90
|
}
|
|
147
91
|
return message;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if (message.value.length) writer.tag(4, WireType.LengthDelimited).bytes(message.value);
|
|
158
|
-
/* string tx = 5; */
|
|
159
|
-
if (message.tx !== "") writer.tag(5, WireType.LengthDelimited).string(message.tx);
|
|
160
|
-
let u = options.writeUnknownFields;
|
|
161
|
-
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
162
|
-
return writer;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* @generated MessageType for protobuf message ecsstream.ECSEvent
|
|
167
|
-
*/
|
|
168
|
-
export const ECSEvent = new ECSEvent$Type();
|
|
169
|
-
// @generated message type with reflection information, may provide speed optimized methods
|
|
170
|
-
class ECSStreamBlockBundleRequest$Type extends MessageType<ECSStreamBlockBundleRequest> {
|
|
171
|
-
constructor() {
|
|
172
|
-
super("ecsstream.ECSStreamBlockBundleRequest", [
|
|
173
|
-
{ no: 1, name: "worldAddress", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
174
|
-
{ no: 2, name: "blockNumber", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
175
|
-
{ no: 3, name: "blockHash", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
176
|
-
{ no: 4, name: "blockTimestamp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
177
|
-
{ no: 5, name: "transactionsConfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
178
|
-
{ no: 6, name: "ecsEvents", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
179
|
-
]);
|
|
180
|
-
}
|
|
181
|
-
create(value?: PartialMessage<ECSStreamBlockBundleRequest>): ECSStreamBlockBundleRequest {
|
|
182
|
-
const message = {
|
|
183
|
-
worldAddress: "",
|
|
184
|
-
blockNumber: false,
|
|
185
|
-
blockHash: false,
|
|
186
|
-
blockTimestamp: false,
|
|
187
|
-
transactionsConfirmed: false,
|
|
188
|
-
ecsEvents: false,
|
|
189
|
-
};
|
|
190
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
191
|
-
if (value !== undefined) reflectionMergePartial<ECSStreamBlockBundleRequest>(this, message, value);
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
fromPartial(object: DeepPartial<ECSEvent>): ECSEvent {
|
|
95
|
+
const message = createBaseECSEvent();
|
|
96
|
+
message.eventType = object.eventType ?? "";
|
|
97
|
+
message.componentId = object.componentId ?? "";
|
|
98
|
+
message.entityId = object.entityId ?? "";
|
|
99
|
+
message.value = object.value ?? new Uint8Array();
|
|
100
|
+
message.tx = object.tx ?? "";
|
|
192
101
|
return message;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
function createBaseECSStreamBlockBundleRequest(): ECSStreamBlockBundleRequest {
|
|
106
|
+
return {
|
|
107
|
+
worldAddress: "",
|
|
108
|
+
blockNumber: false,
|
|
109
|
+
blockHash: false,
|
|
110
|
+
blockTimestamp: false,
|
|
111
|
+
transactionsConfirmed: false,
|
|
112
|
+
ecsEvents: false,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const ECSStreamBlockBundleRequest = {
|
|
117
|
+
encode(message: ECSStreamBlockBundleRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
118
|
+
if (message.worldAddress !== "") {
|
|
119
|
+
writer.uint32(10).string(message.worldAddress);
|
|
120
|
+
}
|
|
121
|
+
if (message.blockNumber === true) {
|
|
122
|
+
writer.uint32(16).bool(message.blockNumber);
|
|
123
|
+
}
|
|
124
|
+
if (message.blockHash === true) {
|
|
125
|
+
writer.uint32(24).bool(message.blockHash);
|
|
126
|
+
}
|
|
127
|
+
if (message.blockTimestamp === true) {
|
|
128
|
+
writer.uint32(32).bool(message.blockTimestamp);
|
|
129
|
+
}
|
|
130
|
+
if (message.transactionsConfirmed === true) {
|
|
131
|
+
writer.uint32(40).bool(message.transactionsConfirmed);
|
|
132
|
+
}
|
|
133
|
+
if (message.ecsEvents === true) {
|
|
134
|
+
writer.uint32(48).bool(message.ecsEvents);
|
|
135
|
+
}
|
|
136
|
+
return writer;
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ECSStreamBlockBundleRequest {
|
|
140
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
141
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
142
|
+
const message = createBaseECSStreamBlockBundleRequest();
|
|
202
143
|
while (reader.pos < end) {
|
|
203
|
-
|
|
204
|
-
switch (
|
|
205
|
-
case
|
|
144
|
+
const tag = reader.uint32();
|
|
145
|
+
switch (tag >>> 3) {
|
|
146
|
+
case 1:
|
|
206
147
|
message.worldAddress = reader.string();
|
|
207
148
|
break;
|
|
208
|
-
case
|
|
149
|
+
case 2:
|
|
209
150
|
message.blockNumber = reader.bool();
|
|
210
151
|
break;
|
|
211
|
-
case
|
|
152
|
+
case 3:
|
|
212
153
|
message.blockHash = reader.bool();
|
|
213
154
|
break;
|
|
214
|
-
case
|
|
155
|
+
case 4:
|
|
215
156
|
message.blockTimestamp = reader.bool();
|
|
216
157
|
break;
|
|
217
|
-
case
|
|
158
|
+
case 5:
|
|
218
159
|
message.transactionsConfirmed = reader.bool();
|
|
219
160
|
break;
|
|
220
|
-
case
|
|
161
|
+
case 6:
|
|
221
162
|
message.ecsEvents = reader.bool();
|
|
222
163
|
break;
|
|
223
164
|
default:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
227
|
-
let d = reader.skip(wireType);
|
|
228
|
-
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
165
|
+
reader.skipType(tag & 7);
|
|
166
|
+
break;
|
|
229
167
|
}
|
|
230
168
|
}
|
|
231
169
|
return message;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
/* bool blockHash = 3; */
|
|
243
|
-
if (message.blockHash !== false) writer.tag(3, WireType.Varint).bool(message.blockHash);
|
|
244
|
-
/* bool blockTimestamp = 4; */
|
|
245
|
-
if (message.blockTimestamp !== false) writer.tag(4, WireType.Varint).bool(message.blockTimestamp);
|
|
246
|
-
/* bool transactionsConfirmed = 5; */
|
|
247
|
-
if (message.transactionsConfirmed !== false) writer.tag(5, WireType.Varint).bool(message.transactionsConfirmed);
|
|
248
|
-
/* bool ecsEvents = 6; */
|
|
249
|
-
if (message.ecsEvents !== false) writer.tag(6, WireType.Varint).bool(message.ecsEvents);
|
|
250
|
-
let u = options.writeUnknownFields;
|
|
251
|
-
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
252
|
-
return writer;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* @generated MessageType for protobuf message ecsstream.ECSStreamBlockBundleRequest
|
|
257
|
-
*/
|
|
258
|
-
export const ECSStreamBlockBundleRequest = new ECSStreamBlockBundleRequest$Type();
|
|
259
|
-
// @generated message type with reflection information, may provide speed optimized methods
|
|
260
|
-
class ECSStreamBlockBundleReply$Type extends MessageType<ECSStreamBlockBundleReply> {
|
|
261
|
-
constructor() {
|
|
262
|
-
super("ecsstream.ECSStreamBlockBundleReply", [
|
|
263
|
-
{ no: 1, name: "blockNumber", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
264
|
-
{ no: 2, name: "blockHash", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
265
|
-
{ no: 3, name: "blockTimestamp", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
266
|
-
{
|
|
267
|
-
no: 4,
|
|
268
|
-
name: "transactionsConfirmed",
|
|
269
|
-
kind: "scalar",
|
|
270
|
-
repeat: 2 /*RepeatType.UNPACKED*/,
|
|
271
|
-
T: 9 /*ScalarType.STRING*/,
|
|
272
|
-
},
|
|
273
|
-
{ no: 5, name: "ecsEvents", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ECSEvent },
|
|
274
|
-
]);
|
|
275
|
-
}
|
|
276
|
-
create(value?: PartialMessage<ECSStreamBlockBundleReply>): ECSStreamBlockBundleReply {
|
|
277
|
-
const message = { blockNumber: 0, blockHash: "", blockTimestamp: 0, transactionsConfirmed: [], ecsEvents: [] };
|
|
278
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
279
|
-
if (value !== undefined) reflectionMergePartial<ECSStreamBlockBundleReply>(this, message, value);
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
fromPartial(object: DeepPartial<ECSStreamBlockBundleRequest>): ECSStreamBlockBundleRequest {
|
|
173
|
+
const message = createBaseECSStreamBlockBundleRequest();
|
|
174
|
+
message.worldAddress = object.worldAddress ?? "";
|
|
175
|
+
message.blockNumber = object.blockNumber ?? false;
|
|
176
|
+
message.blockHash = object.blockHash ?? false;
|
|
177
|
+
message.blockTimestamp = object.blockTimestamp ?? false;
|
|
178
|
+
message.transactionsConfirmed = object.transactionsConfirmed ?? false;
|
|
179
|
+
message.ecsEvents = object.ecsEvents ?? false;
|
|
280
180
|
return message;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
function createBaseECSStreamBlockBundleReply(): ECSStreamBlockBundleReply {
|
|
185
|
+
return { blockNumber: 0, blockHash: "", blockTimestamp: 0, transactionsConfirmed: [], ecsEvents: [] };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export const ECSStreamBlockBundleReply = {
|
|
189
|
+
encode(message: ECSStreamBlockBundleReply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
190
|
+
if (message.blockNumber !== 0) {
|
|
191
|
+
writer.uint32(8).uint32(message.blockNumber);
|
|
192
|
+
}
|
|
193
|
+
if (message.blockHash !== "") {
|
|
194
|
+
writer.uint32(18).string(message.blockHash);
|
|
195
|
+
}
|
|
196
|
+
if (message.blockTimestamp !== 0) {
|
|
197
|
+
writer.uint32(24).uint32(message.blockTimestamp);
|
|
198
|
+
}
|
|
199
|
+
for (const v of message.transactionsConfirmed) {
|
|
200
|
+
writer.uint32(34).string(v!);
|
|
201
|
+
}
|
|
202
|
+
for (const v of message.ecsEvents) {
|
|
203
|
+
ECSEvent.encode(v!, writer.uint32(42).fork()).ldelim();
|
|
204
|
+
}
|
|
205
|
+
return writer;
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ECSStreamBlockBundleReply {
|
|
209
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
210
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
211
|
+
const message = createBaseECSStreamBlockBundleReply();
|
|
290
212
|
while (reader.pos < end) {
|
|
291
|
-
|
|
292
|
-
switch (
|
|
293
|
-
case
|
|
213
|
+
const tag = reader.uint32();
|
|
214
|
+
switch (tag >>> 3) {
|
|
215
|
+
case 1:
|
|
294
216
|
message.blockNumber = reader.uint32();
|
|
295
217
|
break;
|
|
296
|
-
case
|
|
218
|
+
case 2:
|
|
297
219
|
message.blockHash = reader.string();
|
|
298
220
|
break;
|
|
299
|
-
case
|
|
221
|
+
case 3:
|
|
300
222
|
message.blockTimestamp = reader.uint32();
|
|
301
223
|
break;
|
|
302
|
-
case
|
|
224
|
+
case 4:
|
|
303
225
|
message.transactionsConfirmed.push(reader.string());
|
|
304
226
|
break;
|
|
305
|
-
case
|
|
306
|
-
message.ecsEvents.push(ECSEvent.
|
|
227
|
+
case 5:
|
|
228
|
+
message.ecsEvents.push(ECSEvent.decode(reader, reader.uint32()));
|
|
307
229
|
break;
|
|
308
230
|
default:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
312
|
-
let d = reader.skip(wireType);
|
|
313
|
-
if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
231
|
+
reader.skipType(tag & 7);
|
|
232
|
+
break;
|
|
314
233
|
}
|
|
315
234
|
}
|
|
316
235
|
return message;
|
|
317
|
-
}
|
|
318
|
-
internalBinaryWrite(
|
|
319
|
-
message: ECSStreamBlockBundleReply,
|
|
320
|
-
writer: IBinaryWriter,
|
|
321
|
-
options: BinaryWriteOptions
|
|
322
|
-
): IBinaryWriter {
|
|
323
|
-
/* uint32 blockNumber = 1; */
|
|
324
|
-
if (message.blockNumber !== 0) writer.tag(1, WireType.Varint).uint32(message.blockNumber);
|
|
325
|
-
/* string blockHash = 2; */
|
|
326
|
-
if (message.blockHash !== "") writer.tag(2, WireType.LengthDelimited).string(message.blockHash);
|
|
327
|
-
/* uint32 blockTimestamp = 3; */
|
|
328
|
-
if (message.blockTimestamp !== 0) writer.tag(3, WireType.Varint).uint32(message.blockTimestamp);
|
|
329
|
-
/* repeated string transactionsConfirmed = 4; */
|
|
330
|
-
for (let i = 0; i < message.transactionsConfirmed.length; i++)
|
|
331
|
-
writer.tag(4, WireType.LengthDelimited).string(message.transactionsConfirmed[i]);
|
|
332
|
-
/* repeated ecsstream.ECSEvent ecsEvents = 5; */
|
|
333
|
-
for (let i = 0; i < message.ecsEvents.length; i++)
|
|
334
|
-
ECSEvent.internalBinaryWrite(
|
|
335
|
-
message.ecsEvents[i],
|
|
336
|
-
writer.tag(5, WireType.LengthDelimited).fork(),
|
|
337
|
-
options
|
|
338
|
-
).join();
|
|
339
|
-
let u = options.writeUnknownFields;
|
|
340
|
-
if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
341
|
-
return writer;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* @generated MessageType for protobuf message ecsstream.ECSStreamBlockBundleReply
|
|
346
|
-
*/
|
|
347
|
-
export const ECSStreamBlockBundleReply = new ECSStreamBlockBundleReply$Type();
|
|
348
|
-
/**
|
|
349
|
-
* @generated ServiceType for protobuf service ecsstream.ECSStreamService
|
|
350
|
-
*/
|
|
351
|
-
export const ECSStreamService = new ServiceType("ecsstream.ECSStreamService", [
|
|
352
|
-
{
|
|
353
|
-
name: "SubscribeToStreamLatest",
|
|
354
|
-
serverStreaming: true,
|
|
355
|
-
options: {},
|
|
356
|
-
I: ECSStreamBlockBundleRequest,
|
|
357
|
-
O: ECSStreamBlockBundleReply,
|
|
358
236
|
},
|
|
359
|
-
|
|
237
|
+
|
|
238
|
+
fromPartial(object: DeepPartial<ECSStreamBlockBundleReply>): ECSStreamBlockBundleReply {
|
|
239
|
+
const message = createBaseECSStreamBlockBundleReply();
|
|
240
|
+
message.blockNumber = object.blockNumber ?? 0;
|
|
241
|
+
message.blockHash = object.blockHash ?? "";
|
|
242
|
+
message.blockTimestamp = object.blockTimestamp ?? 0;
|
|
243
|
+
message.transactionsConfirmed = object.transactionsConfirmed?.map((e) => e) || [];
|
|
244
|
+
message.ecsEvents = object.ecsEvents?.map((e) => ECSEvent.fromPartial(e)) || [];
|
|
245
|
+
return message;
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
/** The Stream Service definition. */
|
|
250
|
+
export type ECSStreamServiceDefinition = typeof ECSStreamServiceDefinition;
|
|
251
|
+
export const ECSStreamServiceDefinition = {
|
|
252
|
+
name: "ECSStreamService",
|
|
253
|
+
fullName: "ecsstream.ECSStreamService",
|
|
254
|
+
methods: {
|
|
255
|
+
/** Opens a cursor to receive the latest ECS events and additional data specified via request. */
|
|
256
|
+
subscribeToStreamLatest: {
|
|
257
|
+
name: "SubscribeToStreamLatest",
|
|
258
|
+
requestType: ECSStreamBlockBundleRequest,
|
|
259
|
+
requestStream: false,
|
|
260
|
+
responseType: ECSStreamBlockBundleReply,
|
|
261
|
+
responseStream: true,
|
|
262
|
+
options: {},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
} as const;
|
|
266
|
+
|
|
267
|
+
export interface ECSStreamServiceServiceImplementation<CallContextExt = {}> {
|
|
268
|
+
/** Opens a cursor to receive the latest ECS events and additional data specified via request. */
|
|
269
|
+
subscribeToStreamLatest(
|
|
270
|
+
request: ECSStreamBlockBundleRequest,
|
|
271
|
+
context: CallContext & CallContextExt
|
|
272
|
+
): ServerStreamingMethodResult<DeepPartial<ECSStreamBlockBundleReply>>;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface ECSStreamServiceClient<CallOptionsExt = {}> {
|
|
276
|
+
/** Opens a cursor to receive the latest ECS events and additional data specified via request. */
|
|
277
|
+
subscribeToStreamLatest(
|
|
278
|
+
request: DeepPartial<ECSStreamBlockBundleRequest>,
|
|
279
|
+
options?: CallOptions & CallOptionsExt
|
|
280
|
+
): AsyncIterable<ECSStreamBlockBundleReply>;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
284
|
+
|
|
285
|
+
export type DeepPartial<T> = T extends Builtin
|
|
286
|
+
? T
|
|
287
|
+
: T extends Array<infer U>
|
|
288
|
+
? Array<DeepPartial<U>>
|
|
289
|
+
: T extends ReadonlyArray<infer U>
|
|
290
|
+
? ReadonlyArray<DeepPartial<U>>
|
|
291
|
+
: T extends {}
|
|
292
|
+
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
293
|
+
: Partial<T>;
|
|
294
|
+
|
|
295
|
+
export type ServerStreamingMethodResult<Response> = { [Symbol.asyncIterator](): AsyncIterator<Response, void> };
|