@sentio/protos 0.0.0-rc.a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +55 -0
  2. package/lib/builtin.d.ts +6 -0
  3. package/lib/builtin.d.ts.map +1 -0
  4. package/lib/builtin.js +2 -0
  5. package/lib/builtin.js.map +1 -0
  6. package/lib/chainquery/protos/chainquery.d.ts +607 -0
  7. package/lib/chainquery/protos/chainquery.d.ts.map +1 -0
  8. package/lib/chainquery/protos/chainquery.js +1701 -0
  9. package/lib/chainquery/protos/chainquery.js.map +1 -0
  10. package/lib/google/protobuf/empty.d.ts +17 -0
  11. package/lib/google/protobuf/empty.d.ts.map +1 -0
  12. package/lib/google/protobuf/empty.js +40 -0
  13. package/lib/google/protobuf/empty.js.map +1 -0
  14. package/lib/google/protobuf/struct.d.ts +77 -0
  15. package/lib/google/protobuf/struct.d.ts.map +1 -0
  16. package/lib/google/protobuf/struct.js +429 -0
  17. package/lib/google/protobuf/struct.js.map +1 -0
  18. package/lib/google/protobuf/timestamp.d.ts +19 -0
  19. package/lib/google/protobuf/timestamp.d.ts.map +1 -0
  20. package/lib/google/protobuf/timestamp.js +83 -0
  21. package/lib/google/protobuf/timestamp.js.map +1 -0
  22. package/lib/index.d.ts +7 -0
  23. package/lib/index.d.ts.map +1 -0
  24. package/lib/index.js +7 -0
  25. package/lib/index.js.map +1 -0
  26. package/lib/processor/protos/processor.d.ts +1866 -0
  27. package/lib/processor/protos/processor.d.ts.map +1 -0
  28. package/lib/processor/protos/processor.js +11220 -0
  29. package/lib/processor/protos/processor.js.map +1 -0
  30. package/lib/service/common/protos/common.d.ts +1830 -0
  31. package/lib/service/common/protos/common.d.ts.map +1 -0
  32. package/lib/service/common/protos/common.js +12439 -0
  33. package/lib/service/common/protos/common.js.map +1 -0
  34. package/lib/service/price/protos/price.d.ts +359 -0
  35. package/lib/service/price/protos/price.d.ts.map +1 -0
  36. package/lib/service/price/protos/price.js +1435 -0
  37. package/lib/service/price/protos/price.js.map +1 -0
  38. package/package.json +29 -0
  39. package/src/builtin.ts +11 -0
  40. package/src/chainquery/protos/chainquery.ts +2126 -0
  41. package/src/google/protobuf/empty.ts +56 -0
  42. package/src/google/protobuf/struct.ts +494 -0
  43. package/src/google/protobuf/timestamp.ts +106 -0
  44. package/src/index.ts +11 -0
  45. package/src/processor/protos/processor.ts +13151 -0
  46. package/src/service/common/protos/common.ts +14452 -0
@@ -0,0 +1,1701 @@
1
+ /* eslint-disable */
2
+ import Long from "long";
3
+ import _m0 from "protobufjs/minimal.js";
4
+ function createBaseAptosGetTxnsByFunctionRequest() {
5
+ return {
6
+ network: "",
7
+ fromVersion: BigInt("0"),
8
+ toVersion: BigInt("0"),
9
+ function: "",
10
+ matchAll: false,
11
+ typedArguments: [],
12
+ includeChanges: false,
13
+ resourceChangesMoveTypePrefix: "",
14
+ };
15
+ }
16
+ export const AptosGetTxnsByFunctionRequest = {
17
+ encode(message, writer = _m0.Writer.create()) {
18
+ if (message.network !== "") {
19
+ writer.uint32(10).string(message.network);
20
+ }
21
+ if (message.fromVersion !== BigInt("0")) {
22
+ if (BigInt.asUintN(64, message.fromVersion) !== message.fromVersion) {
23
+ throw new globalThis.Error("value provided for field message.fromVersion of type uint64 too large");
24
+ }
25
+ writer.uint32(16).uint64(message.fromVersion.toString());
26
+ }
27
+ if (message.toVersion !== BigInt("0")) {
28
+ if (BigInt.asUintN(64, message.toVersion) !== message.toVersion) {
29
+ throw new globalThis.Error("value provided for field message.toVersion of type uint64 too large");
30
+ }
31
+ writer.uint32(24).uint64(message.toVersion.toString());
32
+ }
33
+ if (message.function !== "") {
34
+ writer.uint32(34).string(message.function);
35
+ }
36
+ if (message.matchAll !== false) {
37
+ writer.uint32(40).bool(message.matchAll);
38
+ }
39
+ for (const v of message.typedArguments) {
40
+ writer.uint32(50).string(v);
41
+ }
42
+ if (message.includeChanges !== false) {
43
+ writer.uint32(56).bool(message.includeChanges);
44
+ }
45
+ if (message.resourceChangesMoveTypePrefix !== "") {
46
+ writer.uint32(66).string(message.resourceChangesMoveTypePrefix);
47
+ }
48
+ return writer;
49
+ },
50
+ decode(input, length) {
51
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
52
+ let end = length === undefined ? reader.len : reader.pos + length;
53
+ const message = createBaseAptosGetTxnsByFunctionRequest();
54
+ while (reader.pos < end) {
55
+ const tag = reader.uint32();
56
+ switch (tag >>> 3) {
57
+ case 1:
58
+ if (tag !== 10) {
59
+ break;
60
+ }
61
+ message.network = reader.string();
62
+ continue;
63
+ case 2:
64
+ if (tag !== 16) {
65
+ break;
66
+ }
67
+ message.fromVersion = longToBigint(reader.uint64());
68
+ continue;
69
+ case 3:
70
+ if (tag !== 24) {
71
+ break;
72
+ }
73
+ message.toVersion = longToBigint(reader.uint64());
74
+ continue;
75
+ case 4:
76
+ if (tag !== 34) {
77
+ break;
78
+ }
79
+ message.function = reader.string();
80
+ continue;
81
+ case 5:
82
+ if (tag !== 40) {
83
+ break;
84
+ }
85
+ message.matchAll = reader.bool();
86
+ continue;
87
+ case 6:
88
+ if (tag !== 50) {
89
+ break;
90
+ }
91
+ message.typedArguments.push(reader.string());
92
+ continue;
93
+ case 7:
94
+ if (tag !== 56) {
95
+ break;
96
+ }
97
+ message.includeChanges = reader.bool();
98
+ continue;
99
+ case 8:
100
+ if (tag !== 66) {
101
+ break;
102
+ }
103
+ message.resourceChangesMoveTypePrefix = reader.string();
104
+ continue;
105
+ }
106
+ if ((tag & 7) === 4 || tag === 0) {
107
+ break;
108
+ }
109
+ reader.skipType(tag & 7);
110
+ }
111
+ return message;
112
+ },
113
+ fromJSON(object) {
114
+ return {
115
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
116
+ fromVersion: isSet(object.fromVersion) ? BigInt(object.fromVersion) : BigInt("0"),
117
+ toVersion: isSet(object.toVersion) ? BigInt(object.toVersion) : BigInt("0"),
118
+ function: isSet(object.function) ? globalThis.String(object.function) : "",
119
+ matchAll: isSet(object.matchAll) ? globalThis.Boolean(object.matchAll) : false,
120
+ typedArguments: globalThis.Array.isArray(object?.typedArguments)
121
+ ? object.typedArguments.map((e) => globalThis.String(e))
122
+ : [],
123
+ includeChanges: isSet(object.includeChanges) ? globalThis.Boolean(object.includeChanges) : false,
124
+ resourceChangesMoveTypePrefix: isSet(object.resourceChangesMoveTypePrefix)
125
+ ? globalThis.String(object.resourceChangesMoveTypePrefix)
126
+ : "",
127
+ };
128
+ },
129
+ toJSON(message) {
130
+ const obj = {};
131
+ if (message.network !== "") {
132
+ obj.network = message.network;
133
+ }
134
+ if (message.fromVersion !== BigInt("0")) {
135
+ obj.fromVersion = message.fromVersion.toString();
136
+ }
137
+ if (message.toVersion !== BigInt("0")) {
138
+ obj.toVersion = message.toVersion.toString();
139
+ }
140
+ if (message.function !== "") {
141
+ obj.function = message.function;
142
+ }
143
+ if (message.matchAll !== false) {
144
+ obj.matchAll = message.matchAll;
145
+ }
146
+ if (message.typedArguments?.length) {
147
+ obj.typedArguments = message.typedArguments;
148
+ }
149
+ if (message.includeChanges !== false) {
150
+ obj.includeChanges = message.includeChanges;
151
+ }
152
+ if (message.resourceChangesMoveTypePrefix !== "") {
153
+ obj.resourceChangesMoveTypePrefix = message.resourceChangesMoveTypePrefix;
154
+ }
155
+ return obj;
156
+ },
157
+ create(base) {
158
+ return AptosGetTxnsByFunctionRequest.fromPartial(base ?? {});
159
+ },
160
+ fromPartial(object) {
161
+ const message = createBaseAptosGetTxnsByFunctionRequest();
162
+ message.network = object.network ?? "";
163
+ message.fromVersion = object.fromVersion ?? BigInt("0");
164
+ message.toVersion = object.toVersion ?? BigInt("0");
165
+ message.function = object.function ?? "";
166
+ message.matchAll = object.matchAll ?? false;
167
+ message.typedArguments = object.typedArguments?.map((e) => e) || [];
168
+ message.includeChanges = object.includeChanges ?? false;
169
+ message.resourceChangesMoveTypePrefix = object.resourceChangesMoveTypePrefix ?? "";
170
+ return message;
171
+ },
172
+ };
173
+ function createBaseAptosGetTxnsByVersionRequest() {
174
+ return { network: "", fromVersion: BigInt("0"), toVersion: BigInt("0"), headerOnly: undefined };
175
+ }
176
+ export const AptosGetTxnsByVersionRequest = {
177
+ encode(message, writer = _m0.Writer.create()) {
178
+ if (message.network !== "") {
179
+ writer.uint32(10).string(message.network);
180
+ }
181
+ if (message.fromVersion !== BigInt("0")) {
182
+ if (BigInt.asUintN(64, message.fromVersion) !== message.fromVersion) {
183
+ throw new globalThis.Error("value provided for field message.fromVersion of type uint64 too large");
184
+ }
185
+ writer.uint32(16).uint64(message.fromVersion.toString());
186
+ }
187
+ if (message.toVersion !== BigInt("0")) {
188
+ if (BigInt.asUintN(64, message.toVersion) !== message.toVersion) {
189
+ throw new globalThis.Error("value provided for field message.toVersion of type uint64 too large");
190
+ }
191
+ writer.uint32(24).uint64(message.toVersion.toString());
192
+ }
193
+ if (message.headerOnly !== undefined) {
194
+ writer.uint32(32).bool(message.headerOnly);
195
+ }
196
+ return writer;
197
+ },
198
+ decode(input, length) {
199
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
200
+ let end = length === undefined ? reader.len : reader.pos + length;
201
+ const message = createBaseAptosGetTxnsByVersionRequest();
202
+ while (reader.pos < end) {
203
+ const tag = reader.uint32();
204
+ switch (tag >>> 3) {
205
+ case 1:
206
+ if (tag !== 10) {
207
+ break;
208
+ }
209
+ message.network = reader.string();
210
+ continue;
211
+ case 2:
212
+ if (tag !== 16) {
213
+ break;
214
+ }
215
+ message.fromVersion = longToBigint(reader.uint64());
216
+ continue;
217
+ case 3:
218
+ if (tag !== 24) {
219
+ break;
220
+ }
221
+ message.toVersion = longToBigint(reader.uint64());
222
+ continue;
223
+ case 4:
224
+ if (tag !== 32) {
225
+ break;
226
+ }
227
+ message.headerOnly = reader.bool();
228
+ continue;
229
+ }
230
+ if ((tag & 7) === 4 || tag === 0) {
231
+ break;
232
+ }
233
+ reader.skipType(tag & 7);
234
+ }
235
+ return message;
236
+ },
237
+ fromJSON(object) {
238
+ return {
239
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
240
+ fromVersion: isSet(object.fromVersion) ? BigInt(object.fromVersion) : BigInt("0"),
241
+ toVersion: isSet(object.toVersion) ? BigInt(object.toVersion) : BigInt("0"),
242
+ headerOnly: isSet(object.headerOnly) ? globalThis.Boolean(object.headerOnly) : undefined,
243
+ };
244
+ },
245
+ toJSON(message) {
246
+ const obj = {};
247
+ if (message.network !== "") {
248
+ obj.network = message.network;
249
+ }
250
+ if (message.fromVersion !== BigInt("0")) {
251
+ obj.fromVersion = message.fromVersion.toString();
252
+ }
253
+ if (message.toVersion !== BigInt("0")) {
254
+ obj.toVersion = message.toVersion.toString();
255
+ }
256
+ if (message.headerOnly !== undefined) {
257
+ obj.headerOnly = message.headerOnly;
258
+ }
259
+ return obj;
260
+ },
261
+ create(base) {
262
+ return AptosGetTxnsByVersionRequest.fromPartial(base ?? {});
263
+ },
264
+ fromPartial(object) {
265
+ const message = createBaseAptosGetTxnsByVersionRequest();
266
+ message.network = object.network ?? "";
267
+ message.fromVersion = object.fromVersion ?? BigInt("0");
268
+ message.toVersion = object.toVersion ?? BigInt("0");
269
+ message.headerOnly = object.headerOnly ?? undefined;
270
+ return message;
271
+ },
272
+ };
273
+ function createBaseAptosGetTxnsByEventRequest() {
274
+ return {
275
+ network: "",
276
+ fromVersion: BigInt("0"),
277
+ toVersion: BigInt("0"),
278
+ address: "",
279
+ type: "",
280
+ includeAllEvents: false,
281
+ includeChanges: false,
282
+ resourceChangesMoveTypePrefix: "",
283
+ };
284
+ }
285
+ export const AptosGetTxnsByEventRequest = {
286
+ encode(message, writer = _m0.Writer.create()) {
287
+ if (message.network !== "") {
288
+ writer.uint32(10).string(message.network);
289
+ }
290
+ if (message.fromVersion !== BigInt("0")) {
291
+ if (BigInt.asUintN(64, message.fromVersion) !== message.fromVersion) {
292
+ throw new globalThis.Error("value provided for field message.fromVersion of type uint64 too large");
293
+ }
294
+ writer.uint32(16).uint64(message.fromVersion.toString());
295
+ }
296
+ if (message.toVersion !== BigInt("0")) {
297
+ if (BigInt.asUintN(64, message.toVersion) !== message.toVersion) {
298
+ throw new globalThis.Error("value provided for field message.toVersion of type uint64 too large");
299
+ }
300
+ writer.uint32(24).uint64(message.toVersion.toString());
301
+ }
302
+ if (message.address !== "") {
303
+ writer.uint32(34).string(message.address);
304
+ }
305
+ if (message.type !== "") {
306
+ writer.uint32(42).string(message.type);
307
+ }
308
+ if (message.includeAllEvents !== false) {
309
+ writer.uint32(48).bool(message.includeAllEvents);
310
+ }
311
+ if (message.includeChanges !== false) {
312
+ writer.uint32(56).bool(message.includeChanges);
313
+ }
314
+ if (message.resourceChangesMoveTypePrefix !== "") {
315
+ writer.uint32(66).string(message.resourceChangesMoveTypePrefix);
316
+ }
317
+ return writer;
318
+ },
319
+ decode(input, length) {
320
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
321
+ let end = length === undefined ? reader.len : reader.pos + length;
322
+ const message = createBaseAptosGetTxnsByEventRequest();
323
+ while (reader.pos < end) {
324
+ const tag = reader.uint32();
325
+ switch (tag >>> 3) {
326
+ case 1:
327
+ if (tag !== 10) {
328
+ break;
329
+ }
330
+ message.network = reader.string();
331
+ continue;
332
+ case 2:
333
+ if (tag !== 16) {
334
+ break;
335
+ }
336
+ message.fromVersion = longToBigint(reader.uint64());
337
+ continue;
338
+ case 3:
339
+ if (tag !== 24) {
340
+ break;
341
+ }
342
+ message.toVersion = longToBigint(reader.uint64());
343
+ continue;
344
+ case 4:
345
+ if (tag !== 34) {
346
+ break;
347
+ }
348
+ message.address = reader.string();
349
+ continue;
350
+ case 5:
351
+ if (tag !== 42) {
352
+ break;
353
+ }
354
+ message.type = reader.string();
355
+ continue;
356
+ case 6:
357
+ if (tag !== 48) {
358
+ break;
359
+ }
360
+ message.includeAllEvents = reader.bool();
361
+ continue;
362
+ case 7:
363
+ if (tag !== 56) {
364
+ break;
365
+ }
366
+ message.includeChanges = reader.bool();
367
+ continue;
368
+ case 8:
369
+ if (tag !== 66) {
370
+ break;
371
+ }
372
+ message.resourceChangesMoveTypePrefix = reader.string();
373
+ continue;
374
+ }
375
+ if ((tag & 7) === 4 || tag === 0) {
376
+ break;
377
+ }
378
+ reader.skipType(tag & 7);
379
+ }
380
+ return message;
381
+ },
382
+ fromJSON(object) {
383
+ return {
384
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
385
+ fromVersion: isSet(object.fromVersion) ? BigInt(object.fromVersion) : BigInt("0"),
386
+ toVersion: isSet(object.toVersion) ? BigInt(object.toVersion) : BigInt("0"),
387
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
388
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
389
+ includeAllEvents: isSet(object.includeAllEvents) ? globalThis.Boolean(object.includeAllEvents) : false,
390
+ includeChanges: isSet(object.includeChanges) ? globalThis.Boolean(object.includeChanges) : false,
391
+ resourceChangesMoveTypePrefix: isSet(object.resourceChangesMoveTypePrefix)
392
+ ? globalThis.String(object.resourceChangesMoveTypePrefix)
393
+ : "",
394
+ };
395
+ },
396
+ toJSON(message) {
397
+ const obj = {};
398
+ if (message.network !== "") {
399
+ obj.network = message.network;
400
+ }
401
+ if (message.fromVersion !== BigInt("0")) {
402
+ obj.fromVersion = message.fromVersion.toString();
403
+ }
404
+ if (message.toVersion !== BigInt("0")) {
405
+ obj.toVersion = message.toVersion.toString();
406
+ }
407
+ if (message.address !== "") {
408
+ obj.address = message.address;
409
+ }
410
+ if (message.type !== "") {
411
+ obj.type = message.type;
412
+ }
413
+ if (message.includeAllEvents !== false) {
414
+ obj.includeAllEvents = message.includeAllEvents;
415
+ }
416
+ if (message.includeChanges !== false) {
417
+ obj.includeChanges = message.includeChanges;
418
+ }
419
+ if (message.resourceChangesMoveTypePrefix !== "") {
420
+ obj.resourceChangesMoveTypePrefix = message.resourceChangesMoveTypePrefix;
421
+ }
422
+ return obj;
423
+ },
424
+ create(base) {
425
+ return AptosGetTxnsByEventRequest.fromPartial(base ?? {});
426
+ },
427
+ fromPartial(object) {
428
+ const message = createBaseAptosGetTxnsByEventRequest();
429
+ message.network = object.network ?? "";
430
+ message.fromVersion = object.fromVersion ?? BigInt("0");
431
+ message.toVersion = object.toVersion ?? BigInt("0");
432
+ message.address = object.address ?? "";
433
+ message.type = object.type ?? "";
434
+ message.includeAllEvents = object.includeAllEvents ?? false;
435
+ message.includeChanges = object.includeChanges ?? false;
436
+ message.resourceChangesMoveTypePrefix = object.resourceChangesMoveTypePrefix ?? "";
437
+ return message;
438
+ },
439
+ };
440
+ function createBaseAptosSQLQueryRequest() {
441
+ return { network: "", fromVersion: BigInt("0"), toVersion: BigInt("0"), sql: "", arbitraryRange: false };
442
+ }
443
+ export const AptosSQLQueryRequest = {
444
+ encode(message, writer = _m0.Writer.create()) {
445
+ if (message.network !== "") {
446
+ writer.uint32(10).string(message.network);
447
+ }
448
+ if (message.fromVersion !== BigInt("0")) {
449
+ if (BigInt.asUintN(64, message.fromVersion) !== message.fromVersion) {
450
+ throw new globalThis.Error("value provided for field message.fromVersion of type uint64 too large");
451
+ }
452
+ writer.uint32(16).uint64(message.fromVersion.toString());
453
+ }
454
+ if (message.toVersion !== BigInt("0")) {
455
+ if (BigInt.asUintN(64, message.toVersion) !== message.toVersion) {
456
+ throw new globalThis.Error("value provided for field message.toVersion of type uint64 too large");
457
+ }
458
+ writer.uint32(24).uint64(message.toVersion.toString());
459
+ }
460
+ if (message.sql !== "") {
461
+ writer.uint32(34).string(message.sql);
462
+ }
463
+ if (message.arbitraryRange !== false) {
464
+ writer.uint32(40).bool(message.arbitraryRange);
465
+ }
466
+ return writer;
467
+ },
468
+ decode(input, length) {
469
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
470
+ let end = length === undefined ? reader.len : reader.pos + length;
471
+ const message = createBaseAptosSQLQueryRequest();
472
+ while (reader.pos < end) {
473
+ const tag = reader.uint32();
474
+ switch (tag >>> 3) {
475
+ case 1:
476
+ if (tag !== 10) {
477
+ break;
478
+ }
479
+ message.network = reader.string();
480
+ continue;
481
+ case 2:
482
+ if (tag !== 16) {
483
+ break;
484
+ }
485
+ message.fromVersion = longToBigint(reader.uint64());
486
+ continue;
487
+ case 3:
488
+ if (tag !== 24) {
489
+ break;
490
+ }
491
+ message.toVersion = longToBigint(reader.uint64());
492
+ continue;
493
+ case 4:
494
+ if (tag !== 34) {
495
+ break;
496
+ }
497
+ message.sql = reader.string();
498
+ continue;
499
+ case 5:
500
+ if (tag !== 40) {
501
+ break;
502
+ }
503
+ message.arbitraryRange = reader.bool();
504
+ continue;
505
+ }
506
+ if ((tag & 7) === 4 || tag === 0) {
507
+ break;
508
+ }
509
+ reader.skipType(tag & 7);
510
+ }
511
+ return message;
512
+ },
513
+ fromJSON(object) {
514
+ return {
515
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
516
+ fromVersion: isSet(object.fromVersion) ? BigInt(object.fromVersion) : BigInt("0"),
517
+ toVersion: isSet(object.toVersion) ? BigInt(object.toVersion) : BigInt("0"),
518
+ sql: isSet(object.sql) ? globalThis.String(object.sql) : "",
519
+ arbitraryRange: isSet(object.arbitraryRange) ? globalThis.Boolean(object.arbitraryRange) : false,
520
+ };
521
+ },
522
+ toJSON(message) {
523
+ const obj = {};
524
+ if (message.network !== "") {
525
+ obj.network = message.network;
526
+ }
527
+ if (message.fromVersion !== BigInt("0")) {
528
+ obj.fromVersion = message.fromVersion.toString();
529
+ }
530
+ if (message.toVersion !== BigInt("0")) {
531
+ obj.toVersion = message.toVersion.toString();
532
+ }
533
+ if (message.sql !== "") {
534
+ obj.sql = message.sql;
535
+ }
536
+ if (message.arbitraryRange !== false) {
537
+ obj.arbitraryRange = message.arbitraryRange;
538
+ }
539
+ return obj;
540
+ },
541
+ create(base) {
542
+ return AptosSQLQueryRequest.fromPartial(base ?? {});
543
+ },
544
+ fromPartial(object) {
545
+ const message = createBaseAptosSQLQueryRequest();
546
+ message.network = object.network ?? "";
547
+ message.fromVersion = object.fromVersion ?? BigInt("0");
548
+ message.toVersion = object.toVersion ?? BigInt("0");
549
+ message.sql = object.sql ?? "";
550
+ message.arbitraryRange = object.arbitraryRange ?? false;
551
+ return message;
552
+ },
553
+ };
554
+ function createBaseQueryPhaseSummary() {
555
+ return { name: "", timeTookMs: BigInt("0") };
556
+ }
557
+ export const QueryPhaseSummary = {
558
+ encode(message, writer = _m0.Writer.create()) {
559
+ if (message.name !== "") {
560
+ writer.uint32(10).string(message.name);
561
+ }
562
+ if (message.timeTookMs !== BigInt("0")) {
563
+ if (BigInt.asUintN(64, message.timeTookMs) !== message.timeTookMs) {
564
+ throw new globalThis.Error("value provided for field message.timeTookMs of type uint64 too large");
565
+ }
566
+ writer.uint32(16).uint64(message.timeTookMs.toString());
567
+ }
568
+ return writer;
569
+ },
570
+ decode(input, length) {
571
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
572
+ let end = length === undefined ? reader.len : reader.pos + length;
573
+ const message = createBaseQueryPhaseSummary();
574
+ while (reader.pos < end) {
575
+ const tag = reader.uint32();
576
+ switch (tag >>> 3) {
577
+ case 1:
578
+ if (tag !== 10) {
579
+ break;
580
+ }
581
+ message.name = reader.string();
582
+ continue;
583
+ case 2:
584
+ if (tag !== 16) {
585
+ break;
586
+ }
587
+ message.timeTookMs = longToBigint(reader.uint64());
588
+ continue;
589
+ }
590
+ if ((tag & 7) === 4 || tag === 0) {
591
+ break;
592
+ }
593
+ reader.skipType(tag & 7);
594
+ }
595
+ return message;
596
+ },
597
+ fromJSON(object) {
598
+ return {
599
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
600
+ timeTookMs: isSet(object.timeTookMs) ? BigInt(object.timeTookMs) : BigInt("0"),
601
+ };
602
+ },
603
+ toJSON(message) {
604
+ const obj = {};
605
+ if (message.name !== "") {
606
+ obj.name = message.name;
607
+ }
608
+ if (message.timeTookMs !== BigInt("0")) {
609
+ obj.timeTookMs = message.timeTookMs.toString();
610
+ }
611
+ return obj;
612
+ },
613
+ create(base) {
614
+ return QueryPhaseSummary.fromPartial(base ?? {});
615
+ },
616
+ fromPartial(object) {
617
+ const message = createBaseQueryPhaseSummary();
618
+ message.name = object.name ?? "";
619
+ message.timeTookMs = object.timeTookMs ?? BigInt("0");
620
+ return message;
621
+ },
622
+ };
623
+ function createBaseQueryExecutionSummary() {
624
+ return {
625
+ timeTookMs: BigInt("0"),
626
+ resultNumRows: undefined,
627
+ resultNumBytes: undefined,
628
+ numPartitionsWithMaterializedView: undefined,
629
+ numPartitionsWithoutMaterializedView: undefined,
630
+ numPartitions: undefined,
631
+ phases: [],
632
+ qcacheSignature: undefined,
633
+ qcacheHit: undefined,
634
+ };
635
+ }
636
+ export const QueryExecutionSummary = {
637
+ encode(message, writer = _m0.Writer.create()) {
638
+ if (message.timeTookMs !== BigInt("0")) {
639
+ if (BigInt.asUintN(64, message.timeTookMs) !== message.timeTookMs) {
640
+ throw new globalThis.Error("value provided for field message.timeTookMs of type uint64 too large");
641
+ }
642
+ writer.uint32(8).uint64(message.timeTookMs.toString());
643
+ }
644
+ if (message.resultNumRows !== undefined) {
645
+ if (BigInt.asUintN(64, message.resultNumRows) !== message.resultNumRows) {
646
+ throw new globalThis.Error("value provided for field message.resultNumRows of type uint64 too large");
647
+ }
648
+ writer.uint32(16).uint64(message.resultNumRows.toString());
649
+ }
650
+ if (message.resultNumBytes !== undefined) {
651
+ if (BigInt.asUintN(64, message.resultNumBytes) !== message.resultNumBytes) {
652
+ throw new globalThis.Error("value provided for field message.resultNumBytes of type uint64 too large");
653
+ }
654
+ writer.uint32(24).uint64(message.resultNumBytes.toString());
655
+ }
656
+ if (message.numPartitionsWithMaterializedView !== undefined) {
657
+ if (BigInt.asUintN(64, message.numPartitionsWithMaterializedView) !== message.numPartitionsWithMaterializedView) {
658
+ throw new globalThis.Error("value provided for field message.numPartitionsWithMaterializedView of type uint64 too large");
659
+ }
660
+ writer.uint32(32).uint64(message.numPartitionsWithMaterializedView.toString());
661
+ }
662
+ if (message.numPartitionsWithoutMaterializedView !== undefined) {
663
+ if (BigInt.asUintN(64, message.numPartitionsWithoutMaterializedView) !==
664
+ message.numPartitionsWithoutMaterializedView) {
665
+ throw new globalThis.Error("value provided for field message.numPartitionsWithoutMaterializedView of type uint64 too large");
666
+ }
667
+ writer.uint32(40).uint64(message.numPartitionsWithoutMaterializedView.toString());
668
+ }
669
+ if (message.numPartitions !== undefined) {
670
+ if (BigInt.asUintN(64, message.numPartitions) !== message.numPartitions) {
671
+ throw new globalThis.Error("value provided for field message.numPartitions of type uint64 too large");
672
+ }
673
+ writer.uint32(48).uint64(message.numPartitions.toString());
674
+ }
675
+ for (const v of message.phases) {
676
+ QueryPhaseSummary.encode(v, writer.uint32(58).fork()).ldelim();
677
+ }
678
+ if (message.qcacheSignature !== undefined) {
679
+ writer.uint32(66).string(message.qcacheSignature);
680
+ }
681
+ if (message.qcacheHit !== undefined) {
682
+ writer.uint32(72).bool(message.qcacheHit);
683
+ }
684
+ return writer;
685
+ },
686
+ decode(input, length) {
687
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
688
+ let end = length === undefined ? reader.len : reader.pos + length;
689
+ const message = createBaseQueryExecutionSummary();
690
+ while (reader.pos < end) {
691
+ const tag = reader.uint32();
692
+ switch (tag >>> 3) {
693
+ case 1:
694
+ if (tag !== 8) {
695
+ break;
696
+ }
697
+ message.timeTookMs = longToBigint(reader.uint64());
698
+ continue;
699
+ case 2:
700
+ if (tag !== 16) {
701
+ break;
702
+ }
703
+ message.resultNumRows = longToBigint(reader.uint64());
704
+ continue;
705
+ case 3:
706
+ if (tag !== 24) {
707
+ break;
708
+ }
709
+ message.resultNumBytes = longToBigint(reader.uint64());
710
+ continue;
711
+ case 4:
712
+ if (tag !== 32) {
713
+ break;
714
+ }
715
+ message.numPartitionsWithMaterializedView = longToBigint(reader.uint64());
716
+ continue;
717
+ case 5:
718
+ if (tag !== 40) {
719
+ break;
720
+ }
721
+ message.numPartitionsWithoutMaterializedView = longToBigint(reader.uint64());
722
+ continue;
723
+ case 6:
724
+ if (tag !== 48) {
725
+ break;
726
+ }
727
+ message.numPartitions = longToBigint(reader.uint64());
728
+ continue;
729
+ case 7:
730
+ if (tag !== 58) {
731
+ break;
732
+ }
733
+ message.phases.push(QueryPhaseSummary.decode(reader, reader.uint32()));
734
+ continue;
735
+ case 8:
736
+ if (tag !== 66) {
737
+ break;
738
+ }
739
+ message.qcacheSignature = reader.string();
740
+ continue;
741
+ case 9:
742
+ if (tag !== 72) {
743
+ break;
744
+ }
745
+ message.qcacheHit = reader.bool();
746
+ continue;
747
+ }
748
+ if ((tag & 7) === 4 || tag === 0) {
749
+ break;
750
+ }
751
+ reader.skipType(tag & 7);
752
+ }
753
+ return message;
754
+ },
755
+ fromJSON(object) {
756
+ return {
757
+ timeTookMs: isSet(object.timeTookMs) ? BigInt(object.timeTookMs) : BigInt("0"),
758
+ resultNumRows: isSet(object.resultNumRows) ? BigInt(object.resultNumRows) : undefined,
759
+ resultNumBytes: isSet(object.resultNumBytes) ? BigInt(object.resultNumBytes) : undefined,
760
+ numPartitionsWithMaterializedView: isSet(object.numPartitionsWithMaterializedView)
761
+ ? BigInt(object.numPartitionsWithMaterializedView)
762
+ : undefined,
763
+ numPartitionsWithoutMaterializedView: isSet(object.numPartitionsWithoutMaterializedView)
764
+ ? BigInt(object.numPartitionsWithoutMaterializedView)
765
+ : undefined,
766
+ numPartitions: isSet(object.numPartitions) ? BigInt(object.numPartitions) : undefined,
767
+ phases: globalThis.Array.isArray(object?.phases)
768
+ ? object.phases.map((e) => QueryPhaseSummary.fromJSON(e))
769
+ : [],
770
+ qcacheSignature: isSet(object.qcacheSignature) ? globalThis.String(object.qcacheSignature) : undefined,
771
+ qcacheHit: isSet(object.qcacheHit) ? globalThis.Boolean(object.qcacheHit) : undefined,
772
+ };
773
+ },
774
+ toJSON(message) {
775
+ const obj = {};
776
+ if (message.timeTookMs !== BigInt("0")) {
777
+ obj.timeTookMs = message.timeTookMs.toString();
778
+ }
779
+ if (message.resultNumRows !== undefined) {
780
+ obj.resultNumRows = message.resultNumRows.toString();
781
+ }
782
+ if (message.resultNumBytes !== undefined) {
783
+ obj.resultNumBytes = message.resultNumBytes.toString();
784
+ }
785
+ if (message.numPartitionsWithMaterializedView !== undefined) {
786
+ obj.numPartitionsWithMaterializedView = message.numPartitionsWithMaterializedView.toString();
787
+ }
788
+ if (message.numPartitionsWithoutMaterializedView !== undefined) {
789
+ obj.numPartitionsWithoutMaterializedView = message.numPartitionsWithoutMaterializedView.toString();
790
+ }
791
+ if (message.numPartitions !== undefined) {
792
+ obj.numPartitions = message.numPartitions.toString();
793
+ }
794
+ if (message.phases?.length) {
795
+ obj.phases = message.phases.map((e) => QueryPhaseSummary.toJSON(e));
796
+ }
797
+ if (message.qcacheSignature !== undefined) {
798
+ obj.qcacheSignature = message.qcacheSignature;
799
+ }
800
+ if (message.qcacheHit !== undefined) {
801
+ obj.qcacheHit = message.qcacheHit;
802
+ }
803
+ return obj;
804
+ },
805
+ create(base) {
806
+ return QueryExecutionSummary.fromPartial(base ?? {});
807
+ },
808
+ fromPartial(object) {
809
+ const message = createBaseQueryExecutionSummary();
810
+ message.timeTookMs = object.timeTookMs ?? BigInt("0");
811
+ message.resultNumRows = object.resultNumRows ?? undefined;
812
+ message.resultNumBytes = object.resultNumBytes ?? undefined;
813
+ message.numPartitionsWithMaterializedView = object.numPartitionsWithMaterializedView ?? undefined;
814
+ message.numPartitionsWithoutMaterializedView = object.numPartitionsWithoutMaterializedView ?? undefined;
815
+ message.numPartitions = object.numPartitions ?? undefined;
816
+ message.phases = object.phases?.map((e) => QueryPhaseSummary.fromPartial(e)) || [];
817
+ message.qcacheSignature = object.qcacheSignature ?? undefined;
818
+ message.qcacheHit = object.qcacheHit ?? undefined;
819
+ return message;
820
+ },
821
+ };
822
+ function createBaseAptosGetTxnsResponse() {
823
+ return { documents: [], executionSummary: undefined };
824
+ }
825
+ export const AptosGetTxnsResponse = {
826
+ encode(message, writer = _m0.Writer.create()) {
827
+ for (const v of message.documents) {
828
+ writer.uint32(10).bytes(v);
829
+ }
830
+ if (message.executionSummary !== undefined) {
831
+ QueryExecutionSummary.encode(message.executionSummary, writer.uint32(18).fork()).ldelim();
832
+ }
833
+ return writer;
834
+ },
835
+ decode(input, length) {
836
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
837
+ let end = length === undefined ? reader.len : reader.pos + length;
838
+ const message = createBaseAptosGetTxnsResponse();
839
+ while (reader.pos < end) {
840
+ const tag = reader.uint32();
841
+ switch (tag >>> 3) {
842
+ case 1:
843
+ if (tag !== 10) {
844
+ break;
845
+ }
846
+ message.documents.push(reader.bytes());
847
+ continue;
848
+ case 2:
849
+ if (tag !== 18) {
850
+ break;
851
+ }
852
+ message.executionSummary = QueryExecutionSummary.decode(reader, reader.uint32());
853
+ continue;
854
+ }
855
+ if ((tag & 7) === 4 || tag === 0) {
856
+ break;
857
+ }
858
+ reader.skipType(tag & 7);
859
+ }
860
+ return message;
861
+ },
862
+ fromJSON(object) {
863
+ return {
864
+ documents: globalThis.Array.isArray(object?.documents)
865
+ ? object.documents.map((e) => bytesFromBase64(e))
866
+ : [],
867
+ executionSummary: isSet(object.executionSummary)
868
+ ? QueryExecutionSummary.fromJSON(object.executionSummary)
869
+ : undefined,
870
+ };
871
+ },
872
+ toJSON(message) {
873
+ const obj = {};
874
+ if (message.documents?.length) {
875
+ obj.documents = message.documents.map((e) => base64FromBytes(e));
876
+ }
877
+ if (message.executionSummary !== undefined) {
878
+ obj.executionSummary = QueryExecutionSummary.toJSON(message.executionSummary);
879
+ }
880
+ return obj;
881
+ },
882
+ create(base) {
883
+ return AptosGetTxnsResponse.fromPartial(base ?? {});
884
+ },
885
+ fromPartial(object) {
886
+ const message = createBaseAptosGetTxnsResponse();
887
+ message.documents = object.documents?.map((e) => e) || [];
888
+ message.executionSummary = (object.executionSummary !== undefined && object.executionSummary !== null)
889
+ ? QueryExecutionSummary.fromPartial(object.executionSummary)
890
+ : undefined;
891
+ return message;
892
+ },
893
+ };
894
+ function createBaseAptosRefreshRequest() {
895
+ return {};
896
+ }
897
+ export const AptosRefreshRequest = {
898
+ encode(_, writer = _m0.Writer.create()) {
899
+ return writer;
900
+ },
901
+ decode(input, length) {
902
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
903
+ let end = length === undefined ? reader.len : reader.pos + length;
904
+ const message = createBaseAptosRefreshRequest();
905
+ while (reader.pos < end) {
906
+ const tag = reader.uint32();
907
+ switch (tag >>> 3) {
908
+ }
909
+ if ((tag & 7) === 4 || tag === 0) {
910
+ break;
911
+ }
912
+ reader.skipType(tag & 7);
913
+ }
914
+ return message;
915
+ },
916
+ fromJSON(_) {
917
+ return {};
918
+ },
919
+ toJSON(_) {
920
+ const obj = {};
921
+ return obj;
922
+ },
923
+ create(base) {
924
+ return AptosRefreshRequest.fromPartial(base ?? {});
925
+ },
926
+ fromPartial(_) {
927
+ const message = createBaseAptosRefreshRequest();
928
+ return message;
929
+ },
930
+ };
931
+ function createBaseVoidResponse() {
932
+ return {};
933
+ }
934
+ export const VoidResponse = {
935
+ encode(_, writer = _m0.Writer.create()) {
936
+ return writer;
937
+ },
938
+ decode(input, length) {
939
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
940
+ let end = length === undefined ? reader.len : reader.pos + length;
941
+ const message = createBaseVoidResponse();
942
+ while (reader.pos < end) {
943
+ const tag = reader.uint32();
944
+ switch (tag >>> 3) {
945
+ }
946
+ if ((tag & 7) === 4 || tag === 0) {
947
+ break;
948
+ }
949
+ reader.skipType(tag & 7);
950
+ }
951
+ return message;
952
+ },
953
+ fromJSON(_) {
954
+ return {};
955
+ },
956
+ toJSON(_) {
957
+ const obj = {};
958
+ return obj;
959
+ },
960
+ create(base) {
961
+ return VoidResponse.fromPartial(base ?? {});
962
+ },
963
+ fromPartial(_) {
964
+ const message = createBaseVoidResponse();
965
+ return message;
966
+ },
967
+ };
968
+ function createBaseEvmSQLQueryRequest() {
969
+ return { network: "", sql: "", nocache: undefined };
970
+ }
971
+ export const EvmSQLQueryRequest = {
972
+ encode(message, writer = _m0.Writer.create()) {
973
+ if (message.network !== "") {
974
+ writer.uint32(10).string(message.network);
975
+ }
976
+ if (message.sql !== "") {
977
+ writer.uint32(18).string(message.sql);
978
+ }
979
+ if (message.nocache !== undefined) {
980
+ writer.uint32(24).bool(message.nocache);
981
+ }
982
+ return writer;
983
+ },
984
+ decode(input, length) {
985
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
986
+ let end = length === undefined ? reader.len : reader.pos + length;
987
+ const message = createBaseEvmSQLQueryRequest();
988
+ while (reader.pos < end) {
989
+ const tag = reader.uint32();
990
+ switch (tag >>> 3) {
991
+ case 1:
992
+ if (tag !== 10) {
993
+ break;
994
+ }
995
+ message.network = reader.string();
996
+ continue;
997
+ case 2:
998
+ if (tag !== 18) {
999
+ break;
1000
+ }
1001
+ message.sql = reader.string();
1002
+ continue;
1003
+ case 3:
1004
+ if (tag !== 24) {
1005
+ break;
1006
+ }
1007
+ message.nocache = reader.bool();
1008
+ continue;
1009
+ }
1010
+ if ((tag & 7) === 4 || tag === 0) {
1011
+ break;
1012
+ }
1013
+ reader.skipType(tag & 7);
1014
+ }
1015
+ return message;
1016
+ },
1017
+ fromJSON(object) {
1018
+ return {
1019
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
1020
+ sql: isSet(object.sql) ? globalThis.String(object.sql) : "",
1021
+ nocache: isSet(object.nocache) ? globalThis.Boolean(object.nocache) : undefined,
1022
+ };
1023
+ },
1024
+ toJSON(message) {
1025
+ const obj = {};
1026
+ if (message.network !== "") {
1027
+ obj.network = message.network;
1028
+ }
1029
+ if (message.sql !== "") {
1030
+ obj.sql = message.sql;
1031
+ }
1032
+ if (message.nocache !== undefined) {
1033
+ obj.nocache = message.nocache;
1034
+ }
1035
+ return obj;
1036
+ },
1037
+ create(base) {
1038
+ return EvmSQLQueryRequest.fromPartial(base ?? {});
1039
+ },
1040
+ fromPartial(object) {
1041
+ const message = createBaseEvmSQLQueryRequest();
1042
+ message.network = object.network ?? "";
1043
+ message.sql = object.sql ?? "";
1044
+ message.nocache = object.nocache ?? undefined;
1045
+ return message;
1046
+ },
1047
+ };
1048
+ function createBaseEvmGetHeaderRequest() {
1049
+ return { network: "", fromBlock: undefined, toBlock: undefined, blockNumbers: [] };
1050
+ }
1051
+ export const EvmGetHeaderRequest = {
1052
+ encode(message, writer = _m0.Writer.create()) {
1053
+ if (message.network !== "") {
1054
+ writer.uint32(10).string(message.network);
1055
+ }
1056
+ if (message.fromBlock !== undefined) {
1057
+ if (BigInt.asUintN(64, message.fromBlock) !== message.fromBlock) {
1058
+ throw new globalThis.Error("value provided for field message.fromBlock of type uint64 too large");
1059
+ }
1060
+ writer.uint32(16).uint64(message.fromBlock.toString());
1061
+ }
1062
+ if (message.toBlock !== undefined) {
1063
+ if (BigInt.asUintN(64, message.toBlock) !== message.toBlock) {
1064
+ throw new globalThis.Error("value provided for field message.toBlock of type uint64 too large");
1065
+ }
1066
+ writer.uint32(24).uint64(message.toBlock.toString());
1067
+ }
1068
+ writer.uint32(34).fork();
1069
+ for (const v of message.blockNumbers) {
1070
+ if (BigInt.asUintN(64, v) !== v) {
1071
+ throw new globalThis.Error("a value provided in array field blockNumbers of type uint64 is too large");
1072
+ }
1073
+ writer.uint64(v.toString());
1074
+ }
1075
+ writer.ldelim();
1076
+ return writer;
1077
+ },
1078
+ decode(input, length) {
1079
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1080
+ let end = length === undefined ? reader.len : reader.pos + length;
1081
+ const message = createBaseEvmGetHeaderRequest();
1082
+ while (reader.pos < end) {
1083
+ const tag = reader.uint32();
1084
+ switch (tag >>> 3) {
1085
+ case 1:
1086
+ if (tag !== 10) {
1087
+ break;
1088
+ }
1089
+ message.network = reader.string();
1090
+ continue;
1091
+ case 2:
1092
+ if (tag !== 16) {
1093
+ break;
1094
+ }
1095
+ message.fromBlock = longToBigint(reader.uint64());
1096
+ continue;
1097
+ case 3:
1098
+ if (tag !== 24) {
1099
+ break;
1100
+ }
1101
+ message.toBlock = longToBigint(reader.uint64());
1102
+ continue;
1103
+ case 4:
1104
+ if (tag === 32) {
1105
+ message.blockNumbers.push(longToBigint(reader.uint64()));
1106
+ continue;
1107
+ }
1108
+ if (tag === 34) {
1109
+ const end2 = reader.uint32() + reader.pos;
1110
+ while (reader.pos < end2) {
1111
+ message.blockNumbers.push(longToBigint(reader.uint64()));
1112
+ }
1113
+ continue;
1114
+ }
1115
+ break;
1116
+ }
1117
+ if ((tag & 7) === 4 || tag === 0) {
1118
+ break;
1119
+ }
1120
+ reader.skipType(tag & 7);
1121
+ }
1122
+ return message;
1123
+ },
1124
+ fromJSON(object) {
1125
+ return {
1126
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
1127
+ fromBlock: isSet(object.fromBlock) ? BigInt(object.fromBlock) : undefined,
1128
+ toBlock: isSet(object.toBlock) ? BigInt(object.toBlock) : undefined,
1129
+ blockNumbers: globalThis.Array.isArray(object?.blockNumbers)
1130
+ ? object.blockNumbers.map((e) => BigInt(e))
1131
+ : [],
1132
+ };
1133
+ },
1134
+ toJSON(message) {
1135
+ const obj = {};
1136
+ if (message.network !== "") {
1137
+ obj.network = message.network;
1138
+ }
1139
+ if (message.fromBlock !== undefined) {
1140
+ obj.fromBlock = message.fromBlock.toString();
1141
+ }
1142
+ if (message.toBlock !== undefined) {
1143
+ obj.toBlock = message.toBlock.toString();
1144
+ }
1145
+ if (message.blockNumbers?.length) {
1146
+ obj.blockNumbers = message.blockNumbers.map((e) => e.toString());
1147
+ }
1148
+ return obj;
1149
+ },
1150
+ create(base) {
1151
+ return EvmGetHeaderRequest.fromPartial(base ?? {});
1152
+ },
1153
+ fromPartial(object) {
1154
+ const message = createBaseEvmGetHeaderRequest();
1155
+ message.network = object.network ?? "";
1156
+ message.fromBlock = object.fromBlock ?? undefined;
1157
+ message.toBlock = object.toBlock ?? undefined;
1158
+ message.blockNumbers = object.blockNumbers?.map((e) => e) || [];
1159
+ return message;
1160
+ },
1161
+ };
1162
+ function createBaseEvmQueryResponse() {
1163
+ return { rows: [], executionSummary: undefined };
1164
+ }
1165
+ export const EvmQueryResponse = {
1166
+ encode(message, writer = _m0.Writer.create()) {
1167
+ for (const v of message.rows) {
1168
+ writer.uint32(10).bytes(v);
1169
+ }
1170
+ if (message.executionSummary !== undefined) {
1171
+ QueryExecutionSummary.encode(message.executionSummary, writer.uint32(18).fork()).ldelim();
1172
+ }
1173
+ return writer;
1174
+ },
1175
+ decode(input, length) {
1176
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1177
+ let end = length === undefined ? reader.len : reader.pos + length;
1178
+ const message = createBaseEvmQueryResponse();
1179
+ while (reader.pos < end) {
1180
+ const tag = reader.uint32();
1181
+ switch (tag >>> 3) {
1182
+ case 1:
1183
+ if (tag !== 10) {
1184
+ break;
1185
+ }
1186
+ message.rows.push(reader.bytes());
1187
+ continue;
1188
+ case 2:
1189
+ if (tag !== 18) {
1190
+ break;
1191
+ }
1192
+ message.executionSummary = QueryExecutionSummary.decode(reader, reader.uint32());
1193
+ continue;
1194
+ }
1195
+ if ((tag & 7) === 4 || tag === 0) {
1196
+ break;
1197
+ }
1198
+ reader.skipType(tag & 7);
1199
+ }
1200
+ return message;
1201
+ },
1202
+ fromJSON(object) {
1203
+ return {
1204
+ rows: globalThis.Array.isArray(object?.rows) ? object.rows.map((e) => bytesFromBase64(e)) : [],
1205
+ executionSummary: isSet(object.executionSummary)
1206
+ ? QueryExecutionSummary.fromJSON(object.executionSummary)
1207
+ : undefined,
1208
+ };
1209
+ },
1210
+ toJSON(message) {
1211
+ const obj = {};
1212
+ if (message.rows?.length) {
1213
+ obj.rows = message.rows.map((e) => base64FromBytes(e));
1214
+ }
1215
+ if (message.executionSummary !== undefined) {
1216
+ obj.executionSummary = QueryExecutionSummary.toJSON(message.executionSummary);
1217
+ }
1218
+ return obj;
1219
+ },
1220
+ create(base) {
1221
+ return EvmQueryResponse.fromPartial(base ?? {});
1222
+ },
1223
+ fromPartial(object) {
1224
+ const message = createBaseEvmQueryResponse();
1225
+ message.rows = object.rows?.map((e) => e) || [];
1226
+ message.executionSummary = (object.executionSummary !== undefined && object.executionSummary !== null)
1227
+ ? QueryExecutionSummary.fromPartial(object.executionSummary)
1228
+ : undefined;
1229
+ return message;
1230
+ },
1231
+ };
1232
+ function createBaseSuiGetCheckpointTimeRequest() {
1233
+ return { network: "", checkpointSequenceNumber: BigInt("0") };
1234
+ }
1235
+ export const SuiGetCheckpointTimeRequest = {
1236
+ encode(message, writer = _m0.Writer.create()) {
1237
+ if (message.network !== "") {
1238
+ writer.uint32(10).string(message.network);
1239
+ }
1240
+ if (message.checkpointSequenceNumber !== BigInt("0")) {
1241
+ if (BigInt.asUintN(64, message.checkpointSequenceNumber) !== message.checkpointSequenceNumber) {
1242
+ throw new globalThis.Error("value provided for field message.checkpointSequenceNumber of type uint64 too large");
1243
+ }
1244
+ writer.uint32(16).uint64(message.checkpointSequenceNumber.toString());
1245
+ }
1246
+ return writer;
1247
+ },
1248
+ decode(input, length) {
1249
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1250
+ let end = length === undefined ? reader.len : reader.pos + length;
1251
+ const message = createBaseSuiGetCheckpointTimeRequest();
1252
+ while (reader.pos < end) {
1253
+ const tag = reader.uint32();
1254
+ switch (tag >>> 3) {
1255
+ case 1:
1256
+ if (tag !== 10) {
1257
+ break;
1258
+ }
1259
+ message.network = reader.string();
1260
+ continue;
1261
+ case 2:
1262
+ if (tag !== 16) {
1263
+ break;
1264
+ }
1265
+ message.checkpointSequenceNumber = longToBigint(reader.uint64());
1266
+ continue;
1267
+ }
1268
+ if ((tag & 7) === 4 || tag === 0) {
1269
+ break;
1270
+ }
1271
+ reader.skipType(tag & 7);
1272
+ }
1273
+ return message;
1274
+ },
1275
+ fromJSON(object) {
1276
+ return {
1277
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
1278
+ checkpointSequenceNumber: isSet(object.checkpointSequenceNumber)
1279
+ ? BigInt(object.checkpointSequenceNumber)
1280
+ : BigInt("0"),
1281
+ };
1282
+ },
1283
+ toJSON(message) {
1284
+ const obj = {};
1285
+ if (message.network !== "") {
1286
+ obj.network = message.network;
1287
+ }
1288
+ if (message.checkpointSequenceNumber !== BigInt("0")) {
1289
+ obj.checkpointSequenceNumber = message.checkpointSequenceNumber.toString();
1290
+ }
1291
+ return obj;
1292
+ },
1293
+ create(base) {
1294
+ return SuiGetCheckpointTimeRequest.fromPartial(base ?? {});
1295
+ },
1296
+ fromPartial(object) {
1297
+ const message = createBaseSuiGetCheckpointTimeRequest();
1298
+ message.network = object.network ?? "";
1299
+ message.checkpointSequenceNumber = object.checkpointSequenceNumber ?? BigInt("0");
1300
+ return message;
1301
+ },
1302
+ };
1303
+ function createBaseSuiGetCheckpointTimeResponse() {
1304
+ return {
1305
+ checkpointTimestampMs: undefined,
1306
+ transactionMinTimestampMs: undefined,
1307
+ transactionMaxTimestampMs: undefined,
1308
+ };
1309
+ }
1310
+ export const SuiGetCheckpointTimeResponse = {
1311
+ encode(message, writer = _m0.Writer.create()) {
1312
+ if (message.checkpointTimestampMs !== undefined) {
1313
+ if (BigInt.asUintN(64, message.checkpointTimestampMs) !== message.checkpointTimestampMs) {
1314
+ throw new globalThis.Error("value provided for field message.checkpointTimestampMs of type uint64 too large");
1315
+ }
1316
+ writer.uint32(8).uint64(message.checkpointTimestampMs.toString());
1317
+ }
1318
+ if (message.transactionMinTimestampMs !== undefined) {
1319
+ if (BigInt.asUintN(64, message.transactionMinTimestampMs) !== message.transactionMinTimestampMs) {
1320
+ throw new globalThis.Error("value provided for field message.transactionMinTimestampMs of type uint64 too large");
1321
+ }
1322
+ writer.uint32(16).uint64(message.transactionMinTimestampMs.toString());
1323
+ }
1324
+ if (message.transactionMaxTimestampMs !== undefined) {
1325
+ if (BigInt.asUintN(64, message.transactionMaxTimestampMs) !== message.transactionMaxTimestampMs) {
1326
+ throw new globalThis.Error("value provided for field message.transactionMaxTimestampMs of type uint64 too large");
1327
+ }
1328
+ writer.uint32(24).uint64(message.transactionMaxTimestampMs.toString());
1329
+ }
1330
+ return writer;
1331
+ },
1332
+ decode(input, length) {
1333
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1334
+ let end = length === undefined ? reader.len : reader.pos + length;
1335
+ const message = createBaseSuiGetCheckpointTimeResponse();
1336
+ while (reader.pos < end) {
1337
+ const tag = reader.uint32();
1338
+ switch (tag >>> 3) {
1339
+ case 1:
1340
+ if (tag !== 8) {
1341
+ break;
1342
+ }
1343
+ message.checkpointTimestampMs = longToBigint(reader.uint64());
1344
+ continue;
1345
+ case 2:
1346
+ if (tag !== 16) {
1347
+ break;
1348
+ }
1349
+ message.transactionMinTimestampMs = longToBigint(reader.uint64());
1350
+ continue;
1351
+ case 3:
1352
+ if (tag !== 24) {
1353
+ break;
1354
+ }
1355
+ message.transactionMaxTimestampMs = longToBigint(reader.uint64());
1356
+ continue;
1357
+ }
1358
+ if ((tag & 7) === 4 || tag === 0) {
1359
+ break;
1360
+ }
1361
+ reader.skipType(tag & 7);
1362
+ }
1363
+ return message;
1364
+ },
1365
+ fromJSON(object) {
1366
+ return {
1367
+ checkpointTimestampMs: isSet(object.checkpointTimestampMs) ? BigInt(object.checkpointTimestampMs) : undefined,
1368
+ transactionMinTimestampMs: isSet(object.transactionMinTimestampMs)
1369
+ ? BigInt(object.transactionMinTimestampMs)
1370
+ : undefined,
1371
+ transactionMaxTimestampMs: isSet(object.transactionMaxTimestampMs)
1372
+ ? BigInt(object.transactionMaxTimestampMs)
1373
+ : undefined,
1374
+ };
1375
+ },
1376
+ toJSON(message) {
1377
+ const obj = {};
1378
+ if (message.checkpointTimestampMs !== undefined) {
1379
+ obj.checkpointTimestampMs = message.checkpointTimestampMs.toString();
1380
+ }
1381
+ if (message.transactionMinTimestampMs !== undefined) {
1382
+ obj.transactionMinTimestampMs = message.transactionMinTimestampMs.toString();
1383
+ }
1384
+ if (message.transactionMaxTimestampMs !== undefined) {
1385
+ obj.transactionMaxTimestampMs = message.transactionMaxTimestampMs.toString();
1386
+ }
1387
+ return obj;
1388
+ },
1389
+ create(base) {
1390
+ return SuiGetCheckpointTimeResponse.fromPartial(base ?? {});
1391
+ },
1392
+ fromPartial(object) {
1393
+ const message = createBaseSuiGetCheckpointTimeResponse();
1394
+ message.checkpointTimestampMs = object.checkpointTimestampMs ?? undefined;
1395
+ message.transactionMinTimestampMs = object.transactionMinTimestampMs ?? undefined;
1396
+ message.transactionMaxTimestampMs = object.transactionMaxTimestampMs ?? undefined;
1397
+ return message;
1398
+ },
1399
+ };
1400
+ function createBaseRemoteResultRequest() {
1401
+ return { token: "", position: 0, keepAlive: false };
1402
+ }
1403
+ export const RemoteResultRequest = {
1404
+ encode(message, writer = _m0.Writer.create()) {
1405
+ if (message.token !== "") {
1406
+ writer.uint32(10).string(message.token);
1407
+ }
1408
+ if (message.position !== 0) {
1409
+ writer.uint32(16).int32(message.position);
1410
+ }
1411
+ if (message.keepAlive !== false) {
1412
+ writer.uint32(24).bool(message.keepAlive);
1413
+ }
1414
+ return writer;
1415
+ },
1416
+ decode(input, length) {
1417
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1418
+ let end = length === undefined ? reader.len : reader.pos + length;
1419
+ const message = createBaseRemoteResultRequest();
1420
+ while (reader.pos < end) {
1421
+ const tag = reader.uint32();
1422
+ switch (tag >>> 3) {
1423
+ case 1:
1424
+ if (tag !== 10) {
1425
+ break;
1426
+ }
1427
+ message.token = reader.string();
1428
+ continue;
1429
+ case 2:
1430
+ if (tag !== 16) {
1431
+ break;
1432
+ }
1433
+ message.position = reader.int32();
1434
+ continue;
1435
+ case 3:
1436
+ if (tag !== 24) {
1437
+ break;
1438
+ }
1439
+ message.keepAlive = reader.bool();
1440
+ continue;
1441
+ }
1442
+ if ((tag & 7) === 4 || tag === 0) {
1443
+ break;
1444
+ }
1445
+ reader.skipType(tag & 7);
1446
+ }
1447
+ return message;
1448
+ },
1449
+ fromJSON(object) {
1450
+ return {
1451
+ token: isSet(object.token) ? globalThis.String(object.token) : "",
1452
+ position: isSet(object.position) ? globalThis.Number(object.position) : 0,
1453
+ keepAlive: isSet(object.keepAlive) ? globalThis.Boolean(object.keepAlive) : false,
1454
+ };
1455
+ },
1456
+ toJSON(message) {
1457
+ const obj = {};
1458
+ if (message.token !== "") {
1459
+ obj.token = message.token;
1460
+ }
1461
+ if (message.position !== 0) {
1462
+ obj.position = Math.round(message.position);
1463
+ }
1464
+ if (message.keepAlive !== false) {
1465
+ obj.keepAlive = message.keepAlive;
1466
+ }
1467
+ return obj;
1468
+ },
1469
+ create(base) {
1470
+ return RemoteResultRequest.fromPartial(base ?? {});
1471
+ },
1472
+ fromPartial(object) {
1473
+ const message = createBaseRemoteResultRequest();
1474
+ message.token = object.token ?? "";
1475
+ message.position = object.position ?? 0;
1476
+ message.keepAlive = object.keepAlive ?? false;
1477
+ return message;
1478
+ },
1479
+ };
1480
+ function createBaseRemoteResultResponse() {
1481
+ return { rows: [] };
1482
+ }
1483
+ export const RemoteResultResponse = {
1484
+ encode(message, writer = _m0.Writer.create()) {
1485
+ for (const v of message.rows) {
1486
+ writer.uint32(10).bytes(v);
1487
+ }
1488
+ return writer;
1489
+ },
1490
+ decode(input, length) {
1491
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1492
+ let end = length === undefined ? reader.len : reader.pos + length;
1493
+ const message = createBaseRemoteResultResponse();
1494
+ while (reader.pos < end) {
1495
+ const tag = reader.uint32();
1496
+ switch (tag >>> 3) {
1497
+ case 1:
1498
+ if (tag !== 10) {
1499
+ break;
1500
+ }
1501
+ message.rows.push(reader.bytes());
1502
+ continue;
1503
+ }
1504
+ if ((tag & 7) === 4 || tag === 0) {
1505
+ break;
1506
+ }
1507
+ reader.skipType(tag & 7);
1508
+ }
1509
+ return message;
1510
+ },
1511
+ fromJSON(object) {
1512
+ return { rows: globalThis.Array.isArray(object?.rows) ? object.rows.map((e) => bytesFromBase64(e)) : [] };
1513
+ },
1514
+ toJSON(message) {
1515
+ const obj = {};
1516
+ if (message.rows?.length) {
1517
+ obj.rows = message.rows.map((e) => base64FromBytes(e));
1518
+ }
1519
+ return obj;
1520
+ },
1521
+ create(base) {
1522
+ return RemoteResultResponse.fromPartial(base ?? {});
1523
+ },
1524
+ fromPartial(object) {
1525
+ const message = createBaseRemoteResultResponse();
1526
+ message.rows = object.rows?.map((e) => e) || [];
1527
+ return message;
1528
+ },
1529
+ };
1530
+ export const AptosQueryDefinition = {
1531
+ name: "AptosQuery",
1532
+ fullName: "chainquery.AptosQuery",
1533
+ methods: {
1534
+ aptosGetTxnsByFunction: {
1535
+ name: "AptosGetTxnsByFunction",
1536
+ requestType: AptosGetTxnsByFunctionRequest,
1537
+ requestStream: false,
1538
+ responseType: AptosGetTxnsResponse,
1539
+ responseStream: false,
1540
+ options: {},
1541
+ },
1542
+ aptosGetTxnsByFunctionStream: {
1543
+ name: "AptosGetTxnsByFunctionStream",
1544
+ requestType: AptosGetTxnsByFunctionRequest,
1545
+ requestStream: false,
1546
+ responseType: AptosGetTxnsResponse,
1547
+ responseStream: true,
1548
+ options: {},
1549
+ },
1550
+ aptosGetTxnsByVersion: {
1551
+ name: "AptosGetTxnsByVersion",
1552
+ requestType: AptosGetTxnsByVersionRequest,
1553
+ requestStream: false,
1554
+ responseType: AptosGetTxnsResponse,
1555
+ responseStream: false,
1556
+ options: {},
1557
+ },
1558
+ aptosGetTxnsByEvent: {
1559
+ name: "AptosGetTxnsByEvent",
1560
+ requestType: AptosGetTxnsByEventRequest,
1561
+ requestStream: false,
1562
+ responseType: AptosGetTxnsResponse,
1563
+ responseStream: false,
1564
+ options: {},
1565
+ },
1566
+ aptosGetTxnsByEventStream: {
1567
+ name: "AptosGetTxnsByEventStream",
1568
+ requestType: AptosGetTxnsByEventRequest,
1569
+ requestStream: false,
1570
+ responseType: AptosGetTxnsResponse,
1571
+ responseStream: true,
1572
+ options: {},
1573
+ },
1574
+ aptosRefresh: {
1575
+ name: "AptosRefresh",
1576
+ requestType: AptosRefreshRequest,
1577
+ requestStream: false,
1578
+ responseType: VoidResponse,
1579
+ responseStream: false,
1580
+ options: {},
1581
+ },
1582
+ aptosSQLQuery: {
1583
+ name: "AptosSQLQuery",
1584
+ requestType: AptosSQLQueryRequest,
1585
+ requestStream: false,
1586
+ responseType: AptosGetTxnsResponse,
1587
+ responseStream: false,
1588
+ options: {},
1589
+ },
1590
+ },
1591
+ };
1592
+ export const EvmQueryDefinition = {
1593
+ name: "EvmQuery",
1594
+ fullName: "chainquery.EvmQuery",
1595
+ methods: {
1596
+ evmSQLQuery: {
1597
+ name: "EvmSQLQuery",
1598
+ requestType: EvmSQLQueryRequest,
1599
+ requestStream: false,
1600
+ responseType: EvmQueryResponse,
1601
+ responseStream: true,
1602
+ options: {},
1603
+ },
1604
+ evmGetHeader: {
1605
+ name: "EvmGetHeader",
1606
+ requestType: EvmGetHeaderRequest,
1607
+ requestStream: false,
1608
+ responseType: EvmQueryResponse,
1609
+ responseStream: false,
1610
+ options: {},
1611
+ },
1612
+ evmHintHeaderCache: {
1613
+ name: "EvmHintHeaderCache",
1614
+ requestType: EvmGetHeaderRequest,
1615
+ requestStream: false,
1616
+ responseType: VoidResponse,
1617
+ responseStream: false,
1618
+ options: {},
1619
+ },
1620
+ },
1621
+ };
1622
+ export const SuiQueryDefinition = {
1623
+ name: "SuiQuery",
1624
+ fullName: "chainquery.SuiQuery",
1625
+ methods: {
1626
+ suiSQLQuery: {
1627
+ name: "SuiSQLQuery",
1628
+ requestType: EvmSQLQueryRequest,
1629
+ requestStream: false,
1630
+ responseType: EvmQueryResponse,
1631
+ responseStream: true,
1632
+ options: {},
1633
+ },
1634
+ getCheckpointTime: {
1635
+ name: "GetCheckpointTime",
1636
+ requestType: SuiGetCheckpointTimeRequest,
1637
+ requestStream: false,
1638
+ responseType: SuiGetCheckpointTimeResponse,
1639
+ responseStream: false,
1640
+ options: {},
1641
+ },
1642
+ },
1643
+ };
1644
+ export const RemoteResultTransferServiceDefinition = {
1645
+ name: "RemoteResultTransferService",
1646
+ fullName: "chainquery.RemoteResultTransferService",
1647
+ methods: {
1648
+ getResult: {
1649
+ name: "GetResult",
1650
+ requestType: RemoteResultRequest,
1651
+ requestStream: false,
1652
+ responseType: RemoteResultResponse,
1653
+ responseStream: false,
1654
+ options: {},
1655
+ },
1656
+ destroyResult: {
1657
+ name: "DestroyResult",
1658
+ requestType: RemoteResultRequest,
1659
+ requestStream: false,
1660
+ responseType: VoidResponse,
1661
+ responseStream: false,
1662
+ options: {},
1663
+ },
1664
+ },
1665
+ };
1666
+ function bytesFromBase64(b64) {
1667
+ if (globalThis.Buffer) {
1668
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1669
+ }
1670
+ else {
1671
+ const bin = globalThis.atob(b64);
1672
+ const arr = new Uint8Array(bin.length);
1673
+ for (let i = 0; i < bin.length; ++i) {
1674
+ arr[i] = bin.charCodeAt(i);
1675
+ }
1676
+ return arr;
1677
+ }
1678
+ }
1679
+ function base64FromBytes(arr) {
1680
+ if (globalThis.Buffer) {
1681
+ return globalThis.Buffer.from(arr).toString("base64");
1682
+ }
1683
+ else {
1684
+ const bin = [];
1685
+ arr.forEach((byte) => {
1686
+ bin.push(globalThis.String.fromCharCode(byte));
1687
+ });
1688
+ return globalThis.btoa(bin.join(""));
1689
+ }
1690
+ }
1691
+ function longToBigint(long) {
1692
+ return BigInt(long.toString());
1693
+ }
1694
+ if (_m0.util.Long !== Long) {
1695
+ _m0.util.Long = Long;
1696
+ _m0.configure();
1697
+ }
1698
+ function isSet(value) {
1699
+ return value !== null && value !== undefined;
1700
+ }
1701
+ //# sourceMappingURL=chainquery.js.map