@apibara/protocol 2.0.0-beta.2 → 2.0.0-beta.21

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,10 +1,133 @@
1
- import _m0 from 'protobufjs/minimal';
1
+ import _m0 from 'protobufjs/minimal.js';
2
2
  import { Schema } from '@effect/schema';
3
3
  import { Option } from 'effect';
4
4
  import { toHex, hexToBytes } from 'viem';
5
5
  import Long from 'long';
6
6
 
7
- const protobufPackage$2 = "dna.v2.common";
7
+ function createBaseDuration() {
8
+ return { seconds: BigInt("0"), nanos: 0 };
9
+ }
10
+ const Duration$1 = {
11
+ encode(message, writer = _m0.Writer.create()) {
12
+ if (message.seconds !== BigInt("0")) {
13
+ if (BigInt.asIntN(64, message.seconds) !== message.seconds) {
14
+ throw new globalThis.Error("value provided for field message.seconds of type int64 too large");
15
+ }
16
+ writer.uint32(8).int64(message.seconds.toString());
17
+ }
18
+ if (message.nanos !== 0) {
19
+ writer.uint32(16).int32(message.nanos);
20
+ }
21
+ return writer;
22
+ },
23
+ decode(input, length) {
24
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
25
+ let end = length === void 0 ? reader.len : reader.pos + length;
26
+ const message = createBaseDuration();
27
+ while (reader.pos < end) {
28
+ const tag = reader.uint32();
29
+ switch (tag >>> 3) {
30
+ case 1:
31
+ if (tag !== 8) {
32
+ break;
33
+ }
34
+ message.seconds = longToBigint$1(reader.int64());
35
+ continue;
36
+ case 2:
37
+ if (tag !== 16) {
38
+ break;
39
+ }
40
+ message.nanos = reader.int32();
41
+ continue;
42
+ }
43
+ if ((tag & 7) === 4 || tag === 0) {
44
+ break;
45
+ }
46
+ reader.skipType(tag & 7);
47
+ }
48
+ return message;
49
+ },
50
+ fromJSON(object) {
51
+ return {
52
+ seconds: isSet$2(object.seconds) ? BigInt(object.seconds) : BigInt("0"),
53
+ nanos: isSet$2(object.nanos) ? globalThis.Number(object.nanos) : 0
54
+ };
55
+ },
56
+ toJSON(message) {
57
+ const obj = {};
58
+ if (message.seconds !== BigInt("0")) {
59
+ obj.seconds = message.seconds.toString();
60
+ }
61
+ if (message.nanos !== 0) {
62
+ obj.nanos = Math.round(message.nanos);
63
+ }
64
+ return obj;
65
+ },
66
+ create(base) {
67
+ return Duration$1.fromPartial(base ?? {});
68
+ },
69
+ fromPartial(object) {
70
+ const message = createBaseDuration();
71
+ message.seconds = object.seconds ?? BigInt("0");
72
+ message.nanos = object.nanos ?? 0;
73
+ return message;
74
+ }
75
+ };
76
+ function longToBigint$1(long) {
77
+ return BigInt(long.toString());
78
+ }
79
+ if (_m0.util.Long !== Long) {
80
+ _m0.util.Long = Long;
81
+ _m0.configure();
82
+ }
83
+ function isSet$2(value) {
84
+ return value !== null && value !== void 0;
85
+ }
86
+
87
+ const protobufPackage$1 = "dna.v2.stream";
88
+ var DataFinality$1 = /* @__PURE__ */ ((DataFinality2) => {
89
+ DataFinality2[DataFinality2["UNKNOWN"] = 0] = "UNKNOWN";
90
+ DataFinality2[DataFinality2["PENDING"] = 1] = "PENDING";
91
+ DataFinality2[DataFinality2["ACCEPTED"] = 2] = "ACCEPTED";
92
+ DataFinality2[DataFinality2["FINALIZED"] = 3] = "FINALIZED";
93
+ DataFinality2[DataFinality2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
94
+ return DataFinality2;
95
+ })(DataFinality$1 || {});
96
+ function dataFinalityFromJSON(object) {
97
+ switch (object) {
98
+ case 0:
99
+ case "DATA_FINALITY_UNKNOWN":
100
+ return 0 /* UNKNOWN */;
101
+ case 1:
102
+ case "DATA_FINALITY_PENDING":
103
+ return 1 /* PENDING */;
104
+ case 2:
105
+ case "DATA_FINALITY_ACCEPTED":
106
+ return 2 /* ACCEPTED */;
107
+ case 3:
108
+ case "DATA_FINALITY_FINALIZED":
109
+ return 3 /* FINALIZED */;
110
+ case -1:
111
+ case "UNRECOGNIZED":
112
+ default:
113
+ return -1 /* UNRECOGNIZED */;
114
+ }
115
+ }
116
+ function dataFinalityToJSON(object) {
117
+ switch (object) {
118
+ case 0 /* UNKNOWN */:
119
+ return "DATA_FINALITY_UNKNOWN";
120
+ case 1 /* PENDING */:
121
+ return "DATA_FINALITY_PENDING";
122
+ case 2 /* ACCEPTED */:
123
+ return "DATA_FINALITY_ACCEPTED";
124
+ case 3 /* FINALIZED */:
125
+ return "DATA_FINALITY_FINALIZED";
126
+ case -1 /* UNRECOGNIZED */:
127
+ default:
128
+ return "UNRECOGNIZED";
129
+ }
130
+ }
8
131
  function createBaseCursor() {
9
132
  return { orderKey: BigInt("0"), uniqueKey: new Uint8Array(0) };
10
133
  }
@@ -50,8 +173,8 @@ const Cursor$1 = {
50
173
  },
51
174
  fromJSON(object) {
52
175
  return {
53
- orderKey: isSet$2(object.orderKey) ? BigInt(object.orderKey) : BigInt("0"),
54
- uniqueKey: isSet$2(object.uniqueKey) ? bytesFromBase64$1(object.uniqueKey) : new Uint8Array(0)
176
+ orderKey: isSet$1(object.orderKey) ? BigInt(object.orderKey) : BigInt("0"),
177
+ uniqueKey: isSet$1(object.uniqueKey) ? bytesFromBase64(object.uniqueKey) : new Uint8Array(0)
55
178
  };
56
179
  },
57
180
  toJSON(message) {
@@ -60,7 +183,7 @@ const Cursor$1 = {
60
183
  obj.orderKey = message.orderKey.toString();
61
184
  }
62
185
  if (message.uniqueKey.length !== 0) {
63
- obj.uniqueKey = base64FromBytes$1(message.uniqueKey);
186
+ obj.uniqueKey = base64FromBytes(message.uniqueKey);
64
187
  }
65
188
  return obj;
66
189
  },
@@ -110,7 +233,7 @@ const StatusRequest = {
110
233
  }
111
234
  };
112
235
  function createBaseStatusResponse() {
113
- return { currentHead: void 0, lastIngested: void 0 };
236
+ return { currentHead: void 0, lastIngested: void 0, finalized: void 0, starting: void 0 };
114
237
  }
115
238
  const StatusResponse = {
116
239
  encode(message, writer = _m0.Writer.create()) {
@@ -120,6 +243,12 @@ const StatusResponse = {
120
243
  if (message.lastIngested !== void 0) {
121
244
  Cursor$1.encode(message.lastIngested, writer.uint32(18).fork()).ldelim();
122
245
  }
246
+ if (message.finalized !== void 0) {
247
+ Cursor$1.encode(message.finalized, writer.uint32(26).fork()).ldelim();
248
+ }
249
+ if (message.starting !== void 0) {
250
+ Cursor$1.encode(message.starting, writer.uint32(34).fork()).ldelim();
251
+ }
123
252
  return writer;
124
253
  },
125
254
  decode(input, length) {
@@ -141,6 +270,18 @@ const StatusResponse = {
141
270
  }
142
271
  message.lastIngested = Cursor$1.decode(reader, reader.uint32());
143
272
  continue;
273
+ case 3:
274
+ if (tag !== 26) {
275
+ break;
276
+ }
277
+ message.finalized = Cursor$1.decode(reader, reader.uint32());
278
+ continue;
279
+ case 4:
280
+ if (tag !== 34) {
281
+ break;
282
+ }
283
+ message.starting = Cursor$1.decode(reader, reader.uint32());
284
+ continue;
144
285
  }
145
286
  if ((tag & 7) === 4 || tag === 0) {
146
287
  break;
@@ -151,8 +292,10 @@ const StatusResponse = {
151
292
  },
152
293
  fromJSON(object) {
153
294
  return {
154
- currentHead: isSet$2(object.currentHead) ? Cursor$1.fromJSON(object.currentHead) : void 0,
155
- lastIngested: isSet$2(object.lastIngested) ? Cursor$1.fromJSON(object.lastIngested) : void 0
295
+ currentHead: isSet$1(object.currentHead) ? Cursor$1.fromJSON(object.currentHead) : void 0,
296
+ lastIngested: isSet$1(object.lastIngested) ? Cursor$1.fromJSON(object.lastIngested) : void 0,
297
+ finalized: isSet$1(object.finalized) ? Cursor$1.fromJSON(object.finalized) : void 0,
298
+ starting: isSet$1(object.starting) ? Cursor$1.fromJSON(object.starting) : void 0
156
299
  };
157
300
  },
158
301
  toJSON(message) {
@@ -163,6 +306,12 @@ const StatusResponse = {
163
306
  if (message.lastIngested !== void 0) {
164
307
  obj.lastIngested = Cursor$1.toJSON(message.lastIngested);
165
308
  }
309
+ if (message.finalized !== void 0) {
310
+ obj.finalized = Cursor$1.toJSON(message.finalized);
311
+ }
312
+ if (message.starting !== void 0) {
313
+ obj.starting = Cursor$1.toJSON(message.starting);
314
+ }
166
315
  return obj;
167
316
  },
168
317
  create(base) {
@@ -172,97 +321,13 @@ const StatusResponse = {
172
321
  const message = createBaseStatusResponse();
173
322
  message.currentHead = object.currentHead !== void 0 && object.currentHead !== null ? Cursor$1.fromPartial(object.currentHead) : void 0;
174
323
  message.lastIngested = object.lastIngested !== void 0 && object.lastIngested !== null ? Cursor$1.fromPartial(object.lastIngested) : void 0;
324
+ message.finalized = object.finalized !== void 0 && object.finalized !== null ? Cursor$1.fromPartial(object.finalized) : void 0;
325
+ message.starting = object.starting !== void 0 && object.starting !== null ? Cursor$1.fromPartial(object.starting) : void 0;
175
326
  return message;
176
327
  }
177
328
  };
178
- function bytesFromBase64$1(b64) {
179
- if (globalThis.Buffer) {
180
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
181
- } else {
182
- const bin = globalThis.atob(b64);
183
- const arr = new Uint8Array(bin.length);
184
- for (let i = 0; i < bin.length; ++i) {
185
- arr[i] = bin.charCodeAt(i);
186
- }
187
- return arr;
188
- }
189
- }
190
- function base64FromBytes$1(arr) {
191
- if (globalThis.Buffer) {
192
- return globalThis.Buffer.from(arr).toString("base64");
193
- } else {
194
- const bin = [];
195
- arr.forEach((byte) => {
196
- bin.push(globalThis.String.fromCharCode(byte));
197
- });
198
- return globalThis.btoa(bin.join(""));
199
- }
200
- }
201
- function longToBigint(long) {
202
- return BigInt(long.toString());
203
- }
204
- if (_m0.util.Long !== Long) {
205
- _m0.util.Long = Long;
206
- _m0.configure();
207
- }
208
- function isSet$2(value) {
209
- return value !== null && value !== void 0;
210
- }
211
-
212
- const common = {
213
- __proto__: null,
214
- Cursor: Cursor$1,
215
- StatusRequest: StatusRequest,
216
- StatusResponse: StatusResponse,
217
- protobufPackage: protobufPackage$2
218
- };
219
-
220
- const protobufPackage$1 = "dna.v2.stream";
221
- var DataFinality$1 = /* @__PURE__ */ ((DataFinality2) => {
222
- DataFinality2[DataFinality2["UNKNOWN"] = 0] = "UNKNOWN";
223
- DataFinality2[DataFinality2["PENDING"] = 1] = "PENDING";
224
- DataFinality2[DataFinality2["ACCEPTED"] = 2] = "ACCEPTED";
225
- DataFinality2[DataFinality2["FINALIZED"] = 3] = "FINALIZED";
226
- DataFinality2[DataFinality2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
227
- return DataFinality2;
228
- })(DataFinality$1 || {});
229
- function dataFinalityFromJSON(object) {
230
- switch (object) {
231
- case 0:
232
- case "DATA_FINALITY_UNKNOWN":
233
- return 0 /* UNKNOWN */;
234
- case 1:
235
- case "DATA_FINALITY_PENDING":
236
- return 1 /* PENDING */;
237
- case 2:
238
- case "DATA_FINALITY_ACCEPTED":
239
- return 2 /* ACCEPTED */;
240
- case 3:
241
- case "DATA_FINALITY_FINALIZED":
242
- return 3 /* FINALIZED */;
243
- case -1:
244
- case "UNRECOGNIZED":
245
- default:
246
- return -1 /* UNRECOGNIZED */;
247
- }
248
- }
249
- function dataFinalityToJSON(object) {
250
- switch (object) {
251
- case 0 /* UNKNOWN */:
252
- return "DATA_FINALITY_UNKNOWN";
253
- case 1 /* PENDING */:
254
- return "DATA_FINALITY_PENDING";
255
- case 2 /* ACCEPTED */:
256
- return "DATA_FINALITY_ACCEPTED";
257
- case 3 /* FINALIZED */:
258
- return "DATA_FINALITY_FINALIZED";
259
- case -1 /* UNRECOGNIZED */:
260
- default:
261
- return "UNRECOGNIZED";
262
- }
263
- }
264
329
  function createBaseStreamDataRequest() {
265
- return { startingCursor: void 0, finality: void 0, filter: [] };
330
+ return { startingCursor: void 0, finality: void 0, filter: [], heartbeatInterval: void 0 };
266
331
  }
267
332
  const StreamDataRequest$1 = {
268
333
  encode(message, writer = _m0.Writer.create()) {
@@ -275,6 +340,9 @@ const StreamDataRequest$1 = {
275
340
  for (const v of message.filter) {
276
341
  writer.uint32(26).bytes(v);
277
342
  }
343
+ if (message.heartbeatInterval !== void 0) {
344
+ Duration$1.encode(message.heartbeatInterval, writer.uint32(34).fork()).ldelim();
345
+ }
278
346
  return writer;
279
347
  },
280
348
  decode(input, length) {
@@ -302,6 +370,12 @@ const StreamDataRequest$1 = {
302
370
  }
303
371
  message.filter.push(reader.bytes());
304
372
  continue;
373
+ case 4:
374
+ if (tag !== 34) {
375
+ break;
376
+ }
377
+ message.heartbeatInterval = Duration$1.decode(reader, reader.uint32());
378
+ continue;
305
379
  }
306
380
  if ((tag & 7) === 4 || tag === 0) {
307
381
  break;
@@ -314,7 +388,8 @@ const StreamDataRequest$1 = {
314
388
  return {
315
389
  startingCursor: isSet$1(object.startingCursor) ? Cursor$1.fromJSON(object.startingCursor) : void 0,
316
390
  finality: isSet$1(object.finality) ? dataFinalityFromJSON(object.finality) : void 0,
317
- filter: globalThis.Array.isArray(object?.filter) ? object.filter.map((e) => bytesFromBase64(e)) : []
391
+ filter: globalThis.Array.isArray(object?.filter) ? object.filter.map((e) => bytesFromBase64(e)) : [],
392
+ heartbeatInterval: isSet$1(object.heartbeatInterval) ? Duration$1.fromJSON(object.heartbeatInterval) : void 0
318
393
  };
319
394
  },
320
395
  toJSON(message) {
@@ -328,6 +403,9 @@ const StreamDataRequest$1 = {
328
403
  if (message.filter?.length) {
329
404
  obj.filter = message.filter.map((e) => base64FromBytes(e));
330
405
  }
406
+ if (message.heartbeatInterval !== void 0) {
407
+ obj.heartbeatInterval = Duration$1.toJSON(message.heartbeatInterval);
408
+ }
331
409
  return obj;
332
410
  },
333
411
  create(base) {
@@ -338,6 +416,7 @@ const StreamDataRequest$1 = {
338
416
  message.startingCursor = object.startingCursor !== void 0 && object.startingCursor !== null ? Cursor$1.fromPartial(object.startingCursor) : void 0;
339
417
  message.finality = object.finality ?? void 0;
340
418
  message.filter = object.filter?.map((e) => e) || [];
419
+ message.heartbeatInterval = object.heartbeatInterval !== void 0 && object.heartbeatInterval !== null ? Duration$1.fromPartial(object.heartbeatInterval) : void 0;
341
420
  return message;
342
421
  }
343
422
  };
@@ -353,11 +432,14 @@ const StreamDataResponse$1 = {
353
432
  case "invalidate":
354
433
  Invalidate$1.encode(message.message.invalidate, writer.uint32(18).fork()).ldelim();
355
434
  break;
435
+ case "finalize":
436
+ Finalize$1.encode(message.message.finalize, writer.uint32(26).fork()).ldelim();
437
+ break;
356
438
  case "heartbeat":
357
- Heartbeat$1.encode(message.message.heartbeat, writer.uint32(26).fork()).ldelim();
439
+ Heartbeat$1.encode(message.message.heartbeat, writer.uint32(34).fork()).ldelim();
358
440
  break;
359
441
  case "systemMessage":
360
- SystemMessage$1.encode(message.message.systemMessage, writer.uint32(34).fork()).ldelim();
442
+ SystemMessage$1.encode(message.message.systemMessage, writer.uint32(42).fork()).ldelim();
361
443
  break;
362
444
  }
363
445
  return writer;
@@ -385,12 +467,18 @@ const StreamDataResponse$1 = {
385
467
  if (tag !== 26) {
386
468
  break;
387
469
  }
388
- message.message = { $case: "heartbeat", heartbeat: Heartbeat$1.decode(reader, reader.uint32()) };
470
+ message.message = { $case: "finalize", finalize: Finalize$1.decode(reader, reader.uint32()) };
389
471
  continue;
390
472
  case 4:
391
473
  if (tag !== 34) {
392
474
  break;
393
475
  }
476
+ message.message = { $case: "heartbeat", heartbeat: Heartbeat$1.decode(reader, reader.uint32()) };
477
+ continue;
478
+ case 5:
479
+ if (tag !== 42) {
480
+ break;
481
+ }
394
482
  message.message = { $case: "systemMessage", systemMessage: SystemMessage$1.decode(reader, reader.uint32()) };
395
483
  continue;
396
484
  }
@@ -403,7 +491,7 @@ const StreamDataResponse$1 = {
403
491
  },
404
492
  fromJSON(object) {
405
493
  return {
406
- message: isSet$1(object.data) ? { $case: "data", data: Data$1.fromJSON(object.data) } : isSet$1(object.invalidate) ? { $case: "invalidate", invalidate: Invalidate$1.fromJSON(object.invalidate) } : isSet$1(object.heartbeat) ? { $case: "heartbeat", heartbeat: Heartbeat$1.fromJSON(object.heartbeat) } : isSet$1(object.systemMessage) ? { $case: "systemMessage", systemMessage: SystemMessage$1.fromJSON(object.systemMessage) } : void 0
494
+ message: isSet$1(object.data) ? { $case: "data", data: Data$1.fromJSON(object.data) } : isSet$1(object.invalidate) ? { $case: "invalidate", invalidate: Invalidate$1.fromJSON(object.invalidate) } : isSet$1(object.finalize) ? { $case: "finalize", finalize: Finalize$1.fromJSON(object.finalize) } : isSet$1(object.heartbeat) ? { $case: "heartbeat", heartbeat: Heartbeat$1.fromJSON(object.heartbeat) } : isSet$1(object.systemMessage) ? { $case: "systemMessage", systemMessage: SystemMessage$1.fromJSON(object.systemMessage) } : void 0
407
495
  };
408
496
  },
409
497
  toJSON(message) {
@@ -414,6 +502,9 @@ const StreamDataResponse$1 = {
414
502
  if (message.message?.$case === "invalidate") {
415
503
  obj.invalidate = Invalidate$1.toJSON(message.message.invalidate);
416
504
  }
505
+ if (message.message?.$case === "finalize") {
506
+ obj.finalize = Finalize$1.toJSON(message.message.finalize);
507
+ }
417
508
  if (message.message?.$case === "heartbeat") {
418
509
  obj.heartbeat = Heartbeat$1.toJSON(message.message.heartbeat);
419
510
  }
@@ -433,6 +524,9 @@ const StreamDataResponse$1 = {
433
524
  if (object.message?.$case === "invalidate" && object.message?.invalidate !== void 0 && object.message?.invalidate !== null) {
434
525
  message.message = { $case: "invalidate", invalidate: Invalidate$1.fromPartial(object.message.invalidate) };
435
526
  }
527
+ if (object.message?.$case === "finalize" && object.message?.finalize !== void 0 && object.message?.finalize !== null) {
528
+ message.message = { $case: "finalize", finalize: Finalize$1.fromPartial(object.message.finalize) };
529
+ }
436
530
  if (object.message?.$case === "heartbeat" && object.message?.heartbeat !== void 0 && object.message?.heartbeat !== null) {
437
531
  message.message = { $case: "heartbeat", heartbeat: Heartbeat$1.fromPartial(object.message.heartbeat) };
438
532
  }
@@ -446,13 +540,16 @@ const StreamDataResponse$1 = {
446
540
  }
447
541
  };
448
542
  function createBaseInvalidate() {
449
- return { cursor: void 0 };
543
+ return { cursor: void 0, removed: [] };
450
544
  }
451
545
  const Invalidate$1 = {
452
546
  encode(message, writer = _m0.Writer.create()) {
453
547
  if (message.cursor !== void 0) {
454
548
  Cursor$1.encode(message.cursor, writer.uint32(10).fork()).ldelim();
455
549
  }
550
+ for (const v of message.removed) {
551
+ Cursor$1.encode(v, writer.uint32(18).fork()).ldelim();
552
+ }
456
553
  return writer;
457
554
  },
458
555
  decode(input, length) {
@@ -468,6 +565,12 @@ const Invalidate$1 = {
468
565
  }
469
566
  message.cursor = Cursor$1.decode(reader, reader.uint32());
470
567
  continue;
568
+ case 2:
569
+ if (tag !== 18) {
570
+ break;
571
+ }
572
+ message.removed.push(Cursor$1.decode(reader, reader.uint32()));
573
+ continue;
471
574
  }
472
575
  if ((tag & 7) === 4 || tag === 0) {
473
576
  break;
@@ -477,13 +580,19 @@ const Invalidate$1 = {
477
580
  return message;
478
581
  },
479
582
  fromJSON(object) {
480
- return { cursor: isSet$1(object.cursor) ? Cursor$1.fromJSON(object.cursor) : void 0 };
583
+ return {
584
+ cursor: isSet$1(object.cursor) ? Cursor$1.fromJSON(object.cursor) : void 0,
585
+ removed: globalThis.Array.isArray(object?.removed) ? object.removed.map((e) => Cursor$1.fromJSON(e)) : []
586
+ };
481
587
  },
482
588
  toJSON(message) {
483
589
  const obj = {};
484
590
  if (message.cursor !== void 0) {
485
591
  obj.cursor = Cursor$1.toJSON(message.cursor);
486
592
  }
593
+ if (message.removed?.length) {
594
+ obj.removed = message.removed.map((e) => Cursor$1.toJSON(e));
595
+ }
487
596
  return obj;
488
597
  },
489
598
  create(base) {
@@ -492,6 +601,57 @@ const Invalidate$1 = {
492
601
  fromPartial(object) {
493
602
  const message = createBaseInvalidate();
494
603
  message.cursor = object.cursor !== void 0 && object.cursor !== null ? Cursor$1.fromPartial(object.cursor) : void 0;
604
+ message.removed = object.removed?.map((e) => Cursor$1.fromPartial(e)) || [];
605
+ return message;
606
+ }
607
+ };
608
+ function createBaseFinalize() {
609
+ return { cursor: void 0 };
610
+ }
611
+ const Finalize$1 = {
612
+ encode(message, writer = _m0.Writer.create()) {
613
+ if (message.cursor !== void 0) {
614
+ Cursor$1.encode(message.cursor, writer.uint32(10).fork()).ldelim();
615
+ }
616
+ return writer;
617
+ },
618
+ decode(input, length) {
619
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
620
+ let end = length === void 0 ? reader.len : reader.pos + length;
621
+ const message = createBaseFinalize();
622
+ while (reader.pos < end) {
623
+ const tag = reader.uint32();
624
+ switch (tag >>> 3) {
625
+ case 1:
626
+ if (tag !== 10) {
627
+ break;
628
+ }
629
+ message.cursor = Cursor$1.decode(reader, reader.uint32());
630
+ continue;
631
+ }
632
+ if ((tag & 7) === 4 || tag === 0) {
633
+ break;
634
+ }
635
+ reader.skipType(tag & 7);
636
+ }
637
+ return message;
638
+ },
639
+ fromJSON(object) {
640
+ return { cursor: isSet$1(object.cursor) ? Cursor$1.fromJSON(object.cursor) : void 0 };
641
+ },
642
+ toJSON(message) {
643
+ const obj = {};
644
+ if (message.cursor !== void 0) {
645
+ obj.cursor = Cursor$1.toJSON(message.cursor);
646
+ }
647
+ return obj;
648
+ },
649
+ create(base) {
650
+ return Finalize$1.fromPartial(base ?? {});
651
+ },
652
+ fromPartial(object) {
653
+ const message = createBaseFinalize();
654
+ message.cursor = object.cursor !== void 0 && object.cursor !== null ? Cursor$1.fromPartial(object.cursor) : void 0;
495
655
  return message;
496
656
  }
497
657
  };
@@ -742,17 +902,28 @@ function base64FromBytes(arr) {
742
902
  return globalThis.btoa(bin.join(""));
743
903
  }
744
904
  }
905
+ function longToBigint(long) {
906
+ return BigInt(long.toString());
907
+ }
908
+ if (_m0.util.Long !== Long) {
909
+ _m0.util.Long = Long;
910
+ _m0.configure();
911
+ }
745
912
  function isSet$1(value) {
746
913
  return value !== null && value !== void 0;
747
914
  }
748
915
 
749
916
  const stream = {
750
917
  __proto__: null,
918
+ Cursor: Cursor$1,
751
919
  Data: Data$1,
752
920
  DataFinality: DataFinality$1,
753
921
  DnaStreamDefinition: DnaStreamDefinition,
922
+ Finalize: Finalize$1,
754
923
  Heartbeat: Heartbeat$1,
755
924
  Invalidate: Invalidate$1,
925
+ StatusRequest: StatusRequest,
926
+ StatusResponse: StatusResponse,
756
927
  StreamDataRequest: StreamDataRequest$1,
757
928
  StreamDataResponse: StreamDataResponse$1,
758
929
  SystemMessage: SystemMessage$1,
@@ -945,10 +1116,15 @@ const DataFinality = Schema.transform(
945
1116
  }
946
1117
  }
947
1118
  );
1119
+ const Duration = Schema.Struct({
1120
+ seconds: Schema.BigIntFromSelf,
1121
+ nanos: Schema.Number
1122
+ });
948
1123
  const StreamDataRequest = (filter) => Schema.Struct({
949
1124
  finality: Schema.optional(DataFinality),
950
1125
  startingCursor: Schema.optional(Cursor),
951
- filter: Schema.mutable(Schema.Array(filter))
1126
+ filter: Schema.mutable(Schema.Array(filter)),
1127
+ heartbeatInterval: Schema.optional(Duration)
952
1128
  });
953
1129
  const Invalidate = Schema.Struct({
954
1130
  _tag: tag("invalidate"),
@@ -956,6 +1132,12 @@ const Invalidate = Schema.Struct({
956
1132
  cursor: Schema.optional(Cursor)
957
1133
  })
958
1134
  });
1135
+ const Finalize = Schema.Struct({
1136
+ _tag: tag("finalize"),
1137
+ finalize: Schema.Struct({
1138
+ cursor: Schema.optional(Cursor)
1139
+ })
1140
+ });
959
1141
  const Heartbeat = Schema.Struct({
960
1142
  _tag: tag("heartbeat")
961
1143
  });
@@ -982,8 +1164,13 @@ const Data = (schema) => Schema.Struct({
982
1164
  data: Schema.Array(schema)
983
1165
  })
984
1166
  });
985
- const StreamDataResponse = (data) => Schema.Union(Data(data), Invalidate, Heartbeat, SystemMessage);
986
- Schema.Union(Invalidate, Heartbeat, SystemMessage);
1167
+ const StreamDataResponse = (data) => Schema.Union(Data(data), Invalidate, Finalize, Heartbeat, SystemMessage);
1168
+ Schema.Union(
1169
+ Invalidate,
1170
+ Finalize,
1171
+ Heartbeat,
1172
+ SystemMessage
1173
+ );
987
1174
  function tag(tag2) {
988
1175
  return Schema.Literal(tag2).pipe(
989
1176
  Schema.propertySignature,
@@ -1025,4 +1212,4 @@ class StreamConfig {
1025
1212
  }
1026
1213
  }
1027
1214
 
1028
- export { Bytes as B, Cursor as C, DnaStreamDefinition as D, Heartbeat as H, Invalidate as I, MockFilter as M, StreamDataResponse as S, _Cursor as _, BytesFromUint8Array as a, createCursor as b, common as c, cursorToProto as d, cursorFromProto as e, CursorFromBytes as f, cursorToBytes as g, cursorFromBytes as h, DataFinality as i, StreamDataRequest as j, StdOut as k, StdErr as l, SystemMessage as m, Data as n, StreamConfig as o, MockBlock as p, stream as s, testing as t };
1215
+ export { Bytes as B, Cursor as C, DnaStreamDefinition as D, Finalize as F, Heartbeat as H, Invalidate as I, MockFilter as M, StreamDataResponse as S, _Cursor as _, BytesFromUint8Array as a, cursorToProto as b, createCursor as c, cursorFromProto as d, CursorFromBytes as e, cursorToBytes as f, cursorFromBytes as g, DataFinality as h, Duration as i, StreamDataRequest as j, StdOut as k, StdErr as l, SystemMessage as m, Data as n, StreamConfig as o, MockBlock as p, stream as s, testing as t };