@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,2126 @@
1
+ /* eslint-disable */
2
+ import Long from "long";
3
+ import type { CallContext, CallOptions } from "nice-grpc-common";
4
+ import _m0 from "protobufjs/minimal.js";
5
+
6
+ export interface AptosGetTxnsByFunctionRequest {
7
+ network: string;
8
+ fromVersion: bigint;
9
+ toVersion: bigint;
10
+ function: string;
11
+ matchAll: boolean;
12
+ typedArguments: string[];
13
+ includeChanges: boolean;
14
+ resourceChangesMoveTypePrefix: string;
15
+ }
16
+
17
+ export interface AptosGetTxnsByVersionRequest {
18
+ network: string;
19
+ fromVersion: bigint;
20
+ toVersion: bigint;
21
+ headerOnly?: boolean | undefined;
22
+ }
23
+
24
+ export interface AptosGetTxnsByEventRequest {
25
+ network: string;
26
+ fromVersion: bigint;
27
+ toVersion: bigint;
28
+ address: string;
29
+ type: string;
30
+ includeAllEvents: boolean;
31
+ includeChanges: boolean;
32
+ resourceChangesMoveTypePrefix: string;
33
+ }
34
+
35
+ export interface AptosSQLQueryRequest {
36
+ network: string;
37
+ fromVersion: bigint;
38
+ toVersion: bigint;
39
+ sql: string;
40
+ arbitraryRange: boolean;
41
+ }
42
+
43
+ export interface QueryPhaseSummary {
44
+ name: string;
45
+ timeTookMs: bigint;
46
+ }
47
+
48
+ export interface QueryExecutionSummary {
49
+ timeTookMs: bigint;
50
+ resultNumRows?: bigint | undefined;
51
+ resultNumBytes?: bigint | undefined;
52
+ numPartitionsWithMaterializedView?: bigint | undefined;
53
+ numPartitionsWithoutMaterializedView?: bigint | undefined;
54
+ numPartitions?: bigint | undefined;
55
+ phases: QueryPhaseSummary[];
56
+ qcacheSignature?: string | undefined;
57
+ qcacheHit?: boolean | undefined;
58
+ }
59
+
60
+ export interface AptosGetTxnsResponse {
61
+ documents: Uint8Array[];
62
+ executionSummary?: QueryExecutionSummary | undefined;
63
+ }
64
+
65
+ export interface AptosRefreshRequest {
66
+ }
67
+
68
+ export interface VoidResponse {
69
+ }
70
+
71
+ export interface EvmSQLQueryRequest {
72
+ network: string;
73
+ sql: string;
74
+ nocache?: boolean | undefined;
75
+ }
76
+
77
+ export interface EvmGetHeaderRequest {
78
+ network: string;
79
+ fromBlock?: bigint | undefined;
80
+ toBlock?: bigint | undefined;
81
+ blockNumbers: bigint[];
82
+ }
83
+
84
+ export interface EvmQueryResponse {
85
+ rows: Uint8Array[];
86
+ executionSummary?: QueryExecutionSummary | undefined;
87
+ }
88
+
89
+ export interface SuiGetCheckpointTimeRequest {
90
+ network: string;
91
+ checkpointSequenceNumber: bigint;
92
+ }
93
+
94
+ export interface SuiGetCheckpointTimeResponse {
95
+ checkpointTimestampMs?: bigint | undefined;
96
+ transactionMinTimestampMs?: bigint | undefined;
97
+ transactionMaxTimestampMs?: bigint | undefined;
98
+ }
99
+
100
+ export interface RemoteResultRequest {
101
+ token: string;
102
+ position: number;
103
+ keepAlive: boolean;
104
+ }
105
+
106
+ export interface RemoteResultResponse {
107
+ rows: Uint8Array[];
108
+ }
109
+
110
+ function createBaseAptosGetTxnsByFunctionRequest(): AptosGetTxnsByFunctionRequest {
111
+ return {
112
+ network: "",
113
+ fromVersion: BigInt("0"),
114
+ toVersion: BigInt("0"),
115
+ function: "",
116
+ matchAll: false,
117
+ typedArguments: [],
118
+ includeChanges: false,
119
+ resourceChangesMoveTypePrefix: "",
120
+ };
121
+ }
122
+
123
+ export const AptosGetTxnsByFunctionRequest = {
124
+ encode(message: AptosGetTxnsByFunctionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
125
+ if (message.network !== "") {
126
+ writer.uint32(10).string(message.network);
127
+ }
128
+ if (message.fromVersion !== BigInt("0")) {
129
+ if (BigInt.asUintN(64, message.fromVersion) !== message.fromVersion) {
130
+ throw new globalThis.Error("value provided for field message.fromVersion of type uint64 too large");
131
+ }
132
+ writer.uint32(16).uint64(message.fromVersion.toString());
133
+ }
134
+ if (message.toVersion !== BigInt("0")) {
135
+ if (BigInt.asUintN(64, message.toVersion) !== message.toVersion) {
136
+ throw new globalThis.Error("value provided for field message.toVersion of type uint64 too large");
137
+ }
138
+ writer.uint32(24).uint64(message.toVersion.toString());
139
+ }
140
+ if (message.function !== "") {
141
+ writer.uint32(34).string(message.function);
142
+ }
143
+ if (message.matchAll !== false) {
144
+ writer.uint32(40).bool(message.matchAll);
145
+ }
146
+ for (const v of message.typedArguments) {
147
+ writer.uint32(50).string(v!);
148
+ }
149
+ if (message.includeChanges !== false) {
150
+ writer.uint32(56).bool(message.includeChanges);
151
+ }
152
+ if (message.resourceChangesMoveTypePrefix !== "") {
153
+ writer.uint32(66).string(message.resourceChangesMoveTypePrefix);
154
+ }
155
+ return writer;
156
+ },
157
+
158
+ decode(input: _m0.Reader | Uint8Array, length?: number): AptosGetTxnsByFunctionRequest {
159
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
160
+ let end = length === undefined ? reader.len : reader.pos + length;
161
+ const message = createBaseAptosGetTxnsByFunctionRequest();
162
+ while (reader.pos < end) {
163
+ const tag = reader.uint32();
164
+ switch (tag >>> 3) {
165
+ case 1:
166
+ if (tag !== 10) {
167
+ break;
168
+ }
169
+
170
+ message.network = reader.string();
171
+ continue;
172
+ case 2:
173
+ if (tag !== 16) {
174
+ break;
175
+ }
176
+
177
+ message.fromVersion = longToBigint(reader.uint64() as Long);
178
+ continue;
179
+ case 3:
180
+ if (tag !== 24) {
181
+ break;
182
+ }
183
+
184
+ message.toVersion = longToBigint(reader.uint64() as Long);
185
+ continue;
186
+ case 4:
187
+ if (tag !== 34) {
188
+ break;
189
+ }
190
+
191
+ message.function = reader.string();
192
+ continue;
193
+ case 5:
194
+ if (tag !== 40) {
195
+ break;
196
+ }
197
+
198
+ message.matchAll = reader.bool();
199
+ continue;
200
+ case 6:
201
+ if (tag !== 50) {
202
+ break;
203
+ }
204
+
205
+ message.typedArguments.push(reader.string());
206
+ continue;
207
+ case 7:
208
+ if (tag !== 56) {
209
+ break;
210
+ }
211
+
212
+ message.includeChanges = reader.bool();
213
+ continue;
214
+ case 8:
215
+ if (tag !== 66) {
216
+ break;
217
+ }
218
+
219
+ message.resourceChangesMoveTypePrefix = reader.string();
220
+ continue;
221
+ }
222
+ if ((tag & 7) === 4 || tag === 0) {
223
+ break;
224
+ }
225
+ reader.skipType(tag & 7);
226
+ }
227
+ return message;
228
+ },
229
+
230
+ fromJSON(object: any): AptosGetTxnsByFunctionRequest {
231
+ return {
232
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
233
+ fromVersion: isSet(object.fromVersion) ? BigInt(object.fromVersion) : BigInt("0"),
234
+ toVersion: isSet(object.toVersion) ? BigInt(object.toVersion) : BigInt("0"),
235
+ function: isSet(object.function) ? globalThis.String(object.function) : "",
236
+ matchAll: isSet(object.matchAll) ? globalThis.Boolean(object.matchAll) : false,
237
+ typedArguments: globalThis.Array.isArray(object?.typedArguments)
238
+ ? object.typedArguments.map((e: any) => globalThis.String(e))
239
+ : [],
240
+ includeChanges: isSet(object.includeChanges) ? globalThis.Boolean(object.includeChanges) : false,
241
+ resourceChangesMoveTypePrefix: isSet(object.resourceChangesMoveTypePrefix)
242
+ ? globalThis.String(object.resourceChangesMoveTypePrefix)
243
+ : "",
244
+ };
245
+ },
246
+
247
+ toJSON(message: AptosGetTxnsByFunctionRequest): unknown {
248
+ const obj: any = {};
249
+ if (message.network !== "") {
250
+ obj.network = message.network;
251
+ }
252
+ if (message.fromVersion !== BigInt("0")) {
253
+ obj.fromVersion = message.fromVersion.toString();
254
+ }
255
+ if (message.toVersion !== BigInt("0")) {
256
+ obj.toVersion = message.toVersion.toString();
257
+ }
258
+ if (message.function !== "") {
259
+ obj.function = message.function;
260
+ }
261
+ if (message.matchAll !== false) {
262
+ obj.matchAll = message.matchAll;
263
+ }
264
+ if (message.typedArguments?.length) {
265
+ obj.typedArguments = message.typedArguments;
266
+ }
267
+ if (message.includeChanges !== false) {
268
+ obj.includeChanges = message.includeChanges;
269
+ }
270
+ if (message.resourceChangesMoveTypePrefix !== "") {
271
+ obj.resourceChangesMoveTypePrefix = message.resourceChangesMoveTypePrefix;
272
+ }
273
+ return obj;
274
+ },
275
+
276
+ create(base?: DeepPartial<AptosGetTxnsByFunctionRequest>): AptosGetTxnsByFunctionRequest {
277
+ return AptosGetTxnsByFunctionRequest.fromPartial(base ?? {});
278
+ },
279
+ fromPartial(object: DeepPartial<AptosGetTxnsByFunctionRequest>): AptosGetTxnsByFunctionRequest {
280
+ const message = createBaseAptosGetTxnsByFunctionRequest();
281
+ message.network = object.network ?? "";
282
+ message.fromVersion = object.fromVersion ?? BigInt("0");
283
+ message.toVersion = object.toVersion ?? BigInt("0");
284
+ message.function = object.function ?? "";
285
+ message.matchAll = object.matchAll ?? false;
286
+ message.typedArguments = object.typedArguments?.map((e) => e) || [];
287
+ message.includeChanges = object.includeChanges ?? false;
288
+ message.resourceChangesMoveTypePrefix = object.resourceChangesMoveTypePrefix ?? "";
289
+ return message;
290
+ },
291
+ };
292
+
293
+ function createBaseAptosGetTxnsByVersionRequest(): AptosGetTxnsByVersionRequest {
294
+ return { network: "", fromVersion: BigInt("0"), toVersion: BigInt("0"), headerOnly: undefined };
295
+ }
296
+
297
+ export const AptosGetTxnsByVersionRequest = {
298
+ encode(message: AptosGetTxnsByVersionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
299
+ if (message.network !== "") {
300
+ writer.uint32(10).string(message.network);
301
+ }
302
+ if (message.fromVersion !== BigInt("0")) {
303
+ if (BigInt.asUintN(64, message.fromVersion) !== message.fromVersion) {
304
+ throw new globalThis.Error("value provided for field message.fromVersion of type uint64 too large");
305
+ }
306
+ writer.uint32(16).uint64(message.fromVersion.toString());
307
+ }
308
+ if (message.toVersion !== BigInt("0")) {
309
+ if (BigInt.asUintN(64, message.toVersion) !== message.toVersion) {
310
+ throw new globalThis.Error("value provided for field message.toVersion of type uint64 too large");
311
+ }
312
+ writer.uint32(24).uint64(message.toVersion.toString());
313
+ }
314
+ if (message.headerOnly !== undefined) {
315
+ writer.uint32(32).bool(message.headerOnly);
316
+ }
317
+ return writer;
318
+ },
319
+
320
+ decode(input: _m0.Reader | Uint8Array, length?: number): AptosGetTxnsByVersionRequest {
321
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
322
+ let end = length === undefined ? reader.len : reader.pos + length;
323
+ const message = createBaseAptosGetTxnsByVersionRequest();
324
+ while (reader.pos < end) {
325
+ const tag = reader.uint32();
326
+ switch (tag >>> 3) {
327
+ case 1:
328
+ if (tag !== 10) {
329
+ break;
330
+ }
331
+
332
+ message.network = reader.string();
333
+ continue;
334
+ case 2:
335
+ if (tag !== 16) {
336
+ break;
337
+ }
338
+
339
+ message.fromVersion = longToBigint(reader.uint64() as Long);
340
+ continue;
341
+ case 3:
342
+ if (tag !== 24) {
343
+ break;
344
+ }
345
+
346
+ message.toVersion = longToBigint(reader.uint64() as Long);
347
+ continue;
348
+ case 4:
349
+ if (tag !== 32) {
350
+ break;
351
+ }
352
+
353
+ message.headerOnly = reader.bool();
354
+ continue;
355
+ }
356
+ if ((tag & 7) === 4 || tag === 0) {
357
+ break;
358
+ }
359
+ reader.skipType(tag & 7);
360
+ }
361
+ return message;
362
+ },
363
+
364
+ fromJSON(object: any): AptosGetTxnsByVersionRequest {
365
+ return {
366
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
367
+ fromVersion: isSet(object.fromVersion) ? BigInt(object.fromVersion) : BigInt("0"),
368
+ toVersion: isSet(object.toVersion) ? BigInt(object.toVersion) : BigInt("0"),
369
+ headerOnly: isSet(object.headerOnly) ? globalThis.Boolean(object.headerOnly) : undefined,
370
+ };
371
+ },
372
+
373
+ toJSON(message: AptosGetTxnsByVersionRequest): unknown {
374
+ const obj: any = {};
375
+ if (message.network !== "") {
376
+ obj.network = message.network;
377
+ }
378
+ if (message.fromVersion !== BigInt("0")) {
379
+ obj.fromVersion = message.fromVersion.toString();
380
+ }
381
+ if (message.toVersion !== BigInt("0")) {
382
+ obj.toVersion = message.toVersion.toString();
383
+ }
384
+ if (message.headerOnly !== undefined) {
385
+ obj.headerOnly = message.headerOnly;
386
+ }
387
+ return obj;
388
+ },
389
+
390
+ create(base?: DeepPartial<AptosGetTxnsByVersionRequest>): AptosGetTxnsByVersionRequest {
391
+ return AptosGetTxnsByVersionRequest.fromPartial(base ?? {});
392
+ },
393
+ fromPartial(object: DeepPartial<AptosGetTxnsByVersionRequest>): AptosGetTxnsByVersionRequest {
394
+ const message = createBaseAptosGetTxnsByVersionRequest();
395
+ message.network = object.network ?? "";
396
+ message.fromVersion = object.fromVersion ?? BigInt("0");
397
+ message.toVersion = object.toVersion ?? BigInt("0");
398
+ message.headerOnly = object.headerOnly ?? undefined;
399
+ return message;
400
+ },
401
+ };
402
+
403
+ function createBaseAptosGetTxnsByEventRequest(): AptosGetTxnsByEventRequest {
404
+ return {
405
+ network: "",
406
+ fromVersion: BigInt("0"),
407
+ toVersion: BigInt("0"),
408
+ address: "",
409
+ type: "",
410
+ includeAllEvents: false,
411
+ includeChanges: false,
412
+ resourceChangesMoveTypePrefix: "",
413
+ };
414
+ }
415
+
416
+ export const AptosGetTxnsByEventRequest = {
417
+ encode(message: AptosGetTxnsByEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
418
+ if (message.network !== "") {
419
+ writer.uint32(10).string(message.network);
420
+ }
421
+ if (message.fromVersion !== BigInt("0")) {
422
+ if (BigInt.asUintN(64, message.fromVersion) !== message.fromVersion) {
423
+ throw new globalThis.Error("value provided for field message.fromVersion of type uint64 too large");
424
+ }
425
+ writer.uint32(16).uint64(message.fromVersion.toString());
426
+ }
427
+ if (message.toVersion !== BigInt("0")) {
428
+ if (BigInt.asUintN(64, message.toVersion) !== message.toVersion) {
429
+ throw new globalThis.Error("value provided for field message.toVersion of type uint64 too large");
430
+ }
431
+ writer.uint32(24).uint64(message.toVersion.toString());
432
+ }
433
+ if (message.address !== "") {
434
+ writer.uint32(34).string(message.address);
435
+ }
436
+ if (message.type !== "") {
437
+ writer.uint32(42).string(message.type);
438
+ }
439
+ if (message.includeAllEvents !== false) {
440
+ writer.uint32(48).bool(message.includeAllEvents);
441
+ }
442
+ if (message.includeChanges !== false) {
443
+ writer.uint32(56).bool(message.includeChanges);
444
+ }
445
+ if (message.resourceChangesMoveTypePrefix !== "") {
446
+ writer.uint32(66).string(message.resourceChangesMoveTypePrefix);
447
+ }
448
+ return writer;
449
+ },
450
+
451
+ decode(input: _m0.Reader | Uint8Array, length?: number): AptosGetTxnsByEventRequest {
452
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
453
+ let end = length === undefined ? reader.len : reader.pos + length;
454
+ const message = createBaseAptosGetTxnsByEventRequest();
455
+ while (reader.pos < end) {
456
+ const tag = reader.uint32();
457
+ switch (tag >>> 3) {
458
+ case 1:
459
+ if (tag !== 10) {
460
+ break;
461
+ }
462
+
463
+ message.network = reader.string();
464
+ continue;
465
+ case 2:
466
+ if (tag !== 16) {
467
+ break;
468
+ }
469
+
470
+ message.fromVersion = longToBigint(reader.uint64() as Long);
471
+ continue;
472
+ case 3:
473
+ if (tag !== 24) {
474
+ break;
475
+ }
476
+
477
+ message.toVersion = longToBigint(reader.uint64() as Long);
478
+ continue;
479
+ case 4:
480
+ if (tag !== 34) {
481
+ break;
482
+ }
483
+
484
+ message.address = reader.string();
485
+ continue;
486
+ case 5:
487
+ if (tag !== 42) {
488
+ break;
489
+ }
490
+
491
+ message.type = reader.string();
492
+ continue;
493
+ case 6:
494
+ if (tag !== 48) {
495
+ break;
496
+ }
497
+
498
+ message.includeAllEvents = reader.bool();
499
+ continue;
500
+ case 7:
501
+ if (tag !== 56) {
502
+ break;
503
+ }
504
+
505
+ message.includeChanges = reader.bool();
506
+ continue;
507
+ case 8:
508
+ if (tag !== 66) {
509
+ break;
510
+ }
511
+
512
+ message.resourceChangesMoveTypePrefix = reader.string();
513
+ continue;
514
+ }
515
+ if ((tag & 7) === 4 || tag === 0) {
516
+ break;
517
+ }
518
+ reader.skipType(tag & 7);
519
+ }
520
+ return message;
521
+ },
522
+
523
+ fromJSON(object: any): AptosGetTxnsByEventRequest {
524
+ return {
525
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
526
+ fromVersion: isSet(object.fromVersion) ? BigInt(object.fromVersion) : BigInt("0"),
527
+ toVersion: isSet(object.toVersion) ? BigInt(object.toVersion) : BigInt("0"),
528
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
529
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
530
+ includeAllEvents: isSet(object.includeAllEvents) ? globalThis.Boolean(object.includeAllEvents) : false,
531
+ includeChanges: isSet(object.includeChanges) ? globalThis.Boolean(object.includeChanges) : false,
532
+ resourceChangesMoveTypePrefix: isSet(object.resourceChangesMoveTypePrefix)
533
+ ? globalThis.String(object.resourceChangesMoveTypePrefix)
534
+ : "",
535
+ };
536
+ },
537
+
538
+ toJSON(message: AptosGetTxnsByEventRequest): unknown {
539
+ const obj: any = {};
540
+ if (message.network !== "") {
541
+ obj.network = message.network;
542
+ }
543
+ if (message.fromVersion !== BigInt("0")) {
544
+ obj.fromVersion = message.fromVersion.toString();
545
+ }
546
+ if (message.toVersion !== BigInt("0")) {
547
+ obj.toVersion = message.toVersion.toString();
548
+ }
549
+ if (message.address !== "") {
550
+ obj.address = message.address;
551
+ }
552
+ if (message.type !== "") {
553
+ obj.type = message.type;
554
+ }
555
+ if (message.includeAllEvents !== false) {
556
+ obj.includeAllEvents = message.includeAllEvents;
557
+ }
558
+ if (message.includeChanges !== false) {
559
+ obj.includeChanges = message.includeChanges;
560
+ }
561
+ if (message.resourceChangesMoveTypePrefix !== "") {
562
+ obj.resourceChangesMoveTypePrefix = message.resourceChangesMoveTypePrefix;
563
+ }
564
+ return obj;
565
+ },
566
+
567
+ create(base?: DeepPartial<AptosGetTxnsByEventRequest>): AptosGetTxnsByEventRequest {
568
+ return AptosGetTxnsByEventRequest.fromPartial(base ?? {});
569
+ },
570
+ fromPartial(object: DeepPartial<AptosGetTxnsByEventRequest>): AptosGetTxnsByEventRequest {
571
+ const message = createBaseAptosGetTxnsByEventRequest();
572
+ message.network = object.network ?? "";
573
+ message.fromVersion = object.fromVersion ?? BigInt("0");
574
+ message.toVersion = object.toVersion ?? BigInt("0");
575
+ message.address = object.address ?? "";
576
+ message.type = object.type ?? "";
577
+ message.includeAllEvents = object.includeAllEvents ?? false;
578
+ message.includeChanges = object.includeChanges ?? false;
579
+ message.resourceChangesMoveTypePrefix = object.resourceChangesMoveTypePrefix ?? "";
580
+ return message;
581
+ },
582
+ };
583
+
584
+ function createBaseAptosSQLQueryRequest(): AptosSQLQueryRequest {
585
+ return { network: "", fromVersion: BigInt("0"), toVersion: BigInt("0"), sql: "", arbitraryRange: false };
586
+ }
587
+
588
+ export const AptosSQLQueryRequest = {
589
+ encode(message: AptosSQLQueryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
590
+ if (message.network !== "") {
591
+ writer.uint32(10).string(message.network);
592
+ }
593
+ if (message.fromVersion !== BigInt("0")) {
594
+ if (BigInt.asUintN(64, message.fromVersion) !== message.fromVersion) {
595
+ throw new globalThis.Error("value provided for field message.fromVersion of type uint64 too large");
596
+ }
597
+ writer.uint32(16).uint64(message.fromVersion.toString());
598
+ }
599
+ if (message.toVersion !== BigInt("0")) {
600
+ if (BigInt.asUintN(64, message.toVersion) !== message.toVersion) {
601
+ throw new globalThis.Error("value provided for field message.toVersion of type uint64 too large");
602
+ }
603
+ writer.uint32(24).uint64(message.toVersion.toString());
604
+ }
605
+ if (message.sql !== "") {
606
+ writer.uint32(34).string(message.sql);
607
+ }
608
+ if (message.arbitraryRange !== false) {
609
+ writer.uint32(40).bool(message.arbitraryRange);
610
+ }
611
+ return writer;
612
+ },
613
+
614
+ decode(input: _m0.Reader | Uint8Array, length?: number): AptosSQLQueryRequest {
615
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
616
+ let end = length === undefined ? reader.len : reader.pos + length;
617
+ const message = createBaseAptosSQLQueryRequest();
618
+ while (reader.pos < end) {
619
+ const tag = reader.uint32();
620
+ switch (tag >>> 3) {
621
+ case 1:
622
+ if (tag !== 10) {
623
+ break;
624
+ }
625
+
626
+ message.network = reader.string();
627
+ continue;
628
+ case 2:
629
+ if (tag !== 16) {
630
+ break;
631
+ }
632
+
633
+ message.fromVersion = longToBigint(reader.uint64() as Long);
634
+ continue;
635
+ case 3:
636
+ if (tag !== 24) {
637
+ break;
638
+ }
639
+
640
+ message.toVersion = longToBigint(reader.uint64() as Long);
641
+ continue;
642
+ case 4:
643
+ if (tag !== 34) {
644
+ break;
645
+ }
646
+
647
+ message.sql = reader.string();
648
+ continue;
649
+ case 5:
650
+ if (tag !== 40) {
651
+ break;
652
+ }
653
+
654
+ message.arbitraryRange = reader.bool();
655
+ continue;
656
+ }
657
+ if ((tag & 7) === 4 || tag === 0) {
658
+ break;
659
+ }
660
+ reader.skipType(tag & 7);
661
+ }
662
+ return message;
663
+ },
664
+
665
+ fromJSON(object: any): AptosSQLQueryRequest {
666
+ return {
667
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
668
+ fromVersion: isSet(object.fromVersion) ? BigInt(object.fromVersion) : BigInt("0"),
669
+ toVersion: isSet(object.toVersion) ? BigInt(object.toVersion) : BigInt("0"),
670
+ sql: isSet(object.sql) ? globalThis.String(object.sql) : "",
671
+ arbitraryRange: isSet(object.arbitraryRange) ? globalThis.Boolean(object.arbitraryRange) : false,
672
+ };
673
+ },
674
+
675
+ toJSON(message: AptosSQLQueryRequest): unknown {
676
+ const obj: any = {};
677
+ if (message.network !== "") {
678
+ obj.network = message.network;
679
+ }
680
+ if (message.fromVersion !== BigInt("0")) {
681
+ obj.fromVersion = message.fromVersion.toString();
682
+ }
683
+ if (message.toVersion !== BigInt("0")) {
684
+ obj.toVersion = message.toVersion.toString();
685
+ }
686
+ if (message.sql !== "") {
687
+ obj.sql = message.sql;
688
+ }
689
+ if (message.arbitraryRange !== false) {
690
+ obj.arbitraryRange = message.arbitraryRange;
691
+ }
692
+ return obj;
693
+ },
694
+
695
+ create(base?: DeepPartial<AptosSQLQueryRequest>): AptosSQLQueryRequest {
696
+ return AptosSQLQueryRequest.fromPartial(base ?? {});
697
+ },
698
+ fromPartial(object: DeepPartial<AptosSQLQueryRequest>): AptosSQLQueryRequest {
699
+ const message = createBaseAptosSQLQueryRequest();
700
+ message.network = object.network ?? "";
701
+ message.fromVersion = object.fromVersion ?? BigInt("0");
702
+ message.toVersion = object.toVersion ?? BigInt("0");
703
+ message.sql = object.sql ?? "";
704
+ message.arbitraryRange = object.arbitraryRange ?? false;
705
+ return message;
706
+ },
707
+ };
708
+
709
+ function createBaseQueryPhaseSummary(): QueryPhaseSummary {
710
+ return { name: "", timeTookMs: BigInt("0") };
711
+ }
712
+
713
+ export const QueryPhaseSummary = {
714
+ encode(message: QueryPhaseSummary, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
715
+ if (message.name !== "") {
716
+ writer.uint32(10).string(message.name);
717
+ }
718
+ if (message.timeTookMs !== BigInt("0")) {
719
+ if (BigInt.asUintN(64, message.timeTookMs) !== message.timeTookMs) {
720
+ throw new globalThis.Error("value provided for field message.timeTookMs of type uint64 too large");
721
+ }
722
+ writer.uint32(16).uint64(message.timeTookMs.toString());
723
+ }
724
+ return writer;
725
+ },
726
+
727
+ decode(input: _m0.Reader | Uint8Array, length?: number): QueryPhaseSummary {
728
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
729
+ let end = length === undefined ? reader.len : reader.pos + length;
730
+ const message = createBaseQueryPhaseSummary();
731
+ while (reader.pos < end) {
732
+ const tag = reader.uint32();
733
+ switch (tag >>> 3) {
734
+ case 1:
735
+ if (tag !== 10) {
736
+ break;
737
+ }
738
+
739
+ message.name = reader.string();
740
+ continue;
741
+ case 2:
742
+ if (tag !== 16) {
743
+ break;
744
+ }
745
+
746
+ message.timeTookMs = longToBigint(reader.uint64() as Long);
747
+ continue;
748
+ }
749
+ if ((tag & 7) === 4 || tag === 0) {
750
+ break;
751
+ }
752
+ reader.skipType(tag & 7);
753
+ }
754
+ return message;
755
+ },
756
+
757
+ fromJSON(object: any): QueryPhaseSummary {
758
+ return {
759
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
760
+ timeTookMs: isSet(object.timeTookMs) ? BigInt(object.timeTookMs) : BigInt("0"),
761
+ };
762
+ },
763
+
764
+ toJSON(message: QueryPhaseSummary): unknown {
765
+ const obj: any = {};
766
+ if (message.name !== "") {
767
+ obj.name = message.name;
768
+ }
769
+ if (message.timeTookMs !== BigInt("0")) {
770
+ obj.timeTookMs = message.timeTookMs.toString();
771
+ }
772
+ return obj;
773
+ },
774
+
775
+ create(base?: DeepPartial<QueryPhaseSummary>): QueryPhaseSummary {
776
+ return QueryPhaseSummary.fromPartial(base ?? {});
777
+ },
778
+ fromPartial(object: DeepPartial<QueryPhaseSummary>): QueryPhaseSummary {
779
+ const message = createBaseQueryPhaseSummary();
780
+ message.name = object.name ?? "";
781
+ message.timeTookMs = object.timeTookMs ?? BigInt("0");
782
+ return message;
783
+ },
784
+ };
785
+
786
+ function createBaseQueryExecutionSummary(): QueryExecutionSummary {
787
+ return {
788
+ timeTookMs: BigInt("0"),
789
+ resultNumRows: undefined,
790
+ resultNumBytes: undefined,
791
+ numPartitionsWithMaterializedView: undefined,
792
+ numPartitionsWithoutMaterializedView: undefined,
793
+ numPartitions: undefined,
794
+ phases: [],
795
+ qcacheSignature: undefined,
796
+ qcacheHit: undefined,
797
+ };
798
+ }
799
+
800
+ export const QueryExecutionSummary = {
801
+ encode(message: QueryExecutionSummary, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
802
+ if (message.timeTookMs !== BigInt("0")) {
803
+ if (BigInt.asUintN(64, message.timeTookMs) !== message.timeTookMs) {
804
+ throw new globalThis.Error("value provided for field message.timeTookMs of type uint64 too large");
805
+ }
806
+ writer.uint32(8).uint64(message.timeTookMs.toString());
807
+ }
808
+ if (message.resultNumRows !== undefined) {
809
+ if (BigInt.asUintN(64, message.resultNumRows) !== message.resultNumRows) {
810
+ throw new globalThis.Error("value provided for field message.resultNumRows of type uint64 too large");
811
+ }
812
+ writer.uint32(16).uint64(message.resultNumRows.toString());
813
+ }
814
+ if (message.resultNumBytes !== undefined) {
815
+ if (BigInt.asUintN(64, message.resultNumBytes) !== message.resultNumBytes) {
816
+ throw new globalThis.Error("value provided for field message.resultNumBytes of type uint64 too large");
817
+ }
818
+ writer.uint32(24).uint64(message.resultNumBytes.toString());
819
+ }
820
+ if (message.numPartitionsWithMaterializedView !== undefined) {
821
+ if (BigInt.asUintN(64, message.numPartitionsWithMaterializedView) !== message.numPartitionsWithMaterializedView) {
822
+ throw new globalThis.Error(
823
+ "value provided for field message.numPartitionsWithMaterializedView of type uint64 too large",
824
+ );
825
+ }
826
+ writer.uint32(32).uint64(message.numPartitionsWithMaterializedView.toString());
827
+ }
828
+ if (message.numPartitionsWithoutMaterializedView !== undefined) {
829
+ if (
830
+ BigInt.asUintN(64, message.numPartitionsWithoutMaterializedView) !==
831
+ message.numPartitionsWithoutMaterializedView
832
+ ) {
833
+ throw new globalThis.Error(
834
+ "value provided for field message.numPartitionsWithoutMaterializedView of type uint64 too large",
835
+ );
836
+ }
837
+ writer.uint32(40).uint64(message.numPartitionsWithoutMaterializedView.toString());
838
+ }
839
+ if (message.numPartitions !== undefined) {
840
+ if (BigInt.asUintN(64, message.numPartitions) !== message.numPartitions) {
841
+ throw new globalThis.Error("value provided for field message.numPartitions of type uint64 too large");
842
+ }
843
+ writer.uint32(48).uint64(message.numPartitions.toString());
844
+ }
845
+ for (const v of message.phases) {
846
+ QueryPhaseSummary.encode(v!, writer.uint32(58).fork()).ldelim();
847
+ }
848
+ if (message.qcacheSignature !== undefined) {
849
+ writer.uint32(66).string(message.qcacheSignature);
850
+ }
851
+ if (message.qcacheHit !== undefined) {
852
+ writer.uint32(72).bool(message.qcacheHit);
853
+ }
854
+ return writer;
855
+ },
856
+
857
+ decode(input: _m0.Reader | Uint8Array, length?: number): QueryExecutionSummary {
858
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
859
+ let end = length === undefined ? reader.len : reader.pos + length;
860
+ const message = createBaseQueryExecutionSummary();
861
+ while (reader.pos < end) {
862
+ const tag = reader.uint32();
863
+ switch (tag >>> 3) {
864
+ case 1:
865
+ if (tag !== 8) {
866
+ break;
867
+ }
868
+
869
+ message.timeTookMs = longToBigint(reader.uint64() as Long);
870
+ continue;
871
+ case 2:
872
+ if (tag !== 16) {
873
+ break;
874
+ }
875
+
876
+ message.resultNumRows = longToBigint(reader.uint64() as Long);
877
+ continue;
878
+ case 3:
879
+ if (tag !== 24) {
880
+ break;
881
+ }
882
+
883
+ message.resultNumBytes = longToBigint(reader.uint64() as Long);
884
+ continue;
885
+ case 4:
886
+ if (tag !== 32) {
887
+ break;
888
+ }
889
+
890
+ message.numPartitionsWithMaterializedView = longToBigint(reader.uint64() as Long);
891
+ continue;
892
+ case 5:
893
+ if (tag !== 40) {
894
+ break;
895
+ }
896
+
897
+ message.numPartitionsWithoutMaterializedView = longToBigint(reader.uint64() as Long);
898
+ continue;
899
+ case 6:
900
+ if (tag !== 48) {
901
+ break;
902
+ }
903
+
904
+ message.numPartitions = longToBigint(reader.uint64() as Long);
905
+ continue;
906
+ case 7:
907
+ if (tag !== 58) {
908
+ break;
909
+ }
910
+
911
+ message.phases.push(QueryPhaseSummary.decode(reader, reader.uint32()));
912
+ continue;
913
+ case 8:
914
+ if (tag !== 66) {
915
+ break;
916
+ }
917
+
918
+ message.qcacheSignature = reader.string();
919
+ continue;
920
+ case 9:
921
+ if (tag !== 72) {
922
+ break;
923
+ }
924
+
925
+ message.qcacheHit = reader.bool();
926
+ continue;
927
+ }
928
+ if ((tag & 7) === 4 || tag === 0) {
929
+ break;
930
+ }
931
+ reader.skipType(tag & 7);
932
+ }
933
+ return message;
934
+ },
935
+
936
+ fromJSON(object: any): QueryExecutionSummary {
937
+ return {
938
+ timeTookMs: isSet(object.timeTookMs) ? BigInt(object.timeTookMs) : BigInt("0"),
939
+ resultNumRows: isSet(object.resultNumRows) ? BigInt(object.resultNumRows) : undefined,
940
+ resultNumBytes: isSet(object.resultNumBytes) ? BigInt(object.resultNumBytes) : undefined,
941
+ numPartitionsWithMaterializedView: isSet(object.numPartitionsWithMaterializedView)
942
+ ? BigInt(object.numPartitionsWithMaterializedView)
943
+ : undefined,
944
+ numPartitionsWithoutMaterializedView: isSet(object.numPartitionsWithoutMaterializedView)
945
+ ? BigInt(object.numPartitionsWithoutMaterializedView)
946
+ : undefined,
947
+ numPartitions: isSet(object.numPartitions) ? BigInt(object.numPartitions) : undefined,
948
+ phases: globalThis.Array.isArray(object?.phases)
949
+ ? object.phases.map((e: any) => QueryPhaseSummary.fromJSON(e))
950
+ : [],
951
+ qcacheSignature: isSet(object.qcacheSignature) ? globalThis.String(object.qcacheSignature) : undefined,
952
+ qcacheHit: isSet(object.qcacheHit) ? globalThis.Boolean(object.qcacheHit) : undefined,
953
+ };
954
+ },
955
+
956
+ toJSON(message: QueryExecutionSummary): unknown {
957
+ const obj: any = {};
958
+ if (message.timeTookMs !== BigInt("0")) {
959
+ obj.timeTookMs = message.timeTookMs.toString();
960
+ }
961
+ if (message.resultNumRows !== undefined) {
962
+ obj.resultNumRows = message.resultNumRows.toString();
963
+ }
964
+ if (message.resultNumBytes !== undefined) {
965
+ obj.resultNumBytes = message.resultNumBytes.toString();
966
+ }
967
+ if (message.numPartitionsWithMaterializedView !== undefined) {
968
+ obj.numPartitionsWithMaterializedView = message.numPartitionsWithMaterializedView.toString();
969
+ }
970
+ if (message.numPartitionsWithoutMaterializedView !== undefined) {
971
+ obj.numPartitionsWithoutMaterializedView = message.numPartitionsWithoutMaterializedView.toString();
972
+ }
973
+ if (message.numPartitions !== undefined) {
974
+ obj.numPartitions = message.numPartitions.toString();
975
+ }
976
+ if (message.phases?.length) {
977
+ obj.phases = message.phases.map((e) => QueryPhaseSummary.toJSON(e));
978
+ }
979
+ if (message.qcacheSignature !== undefined) {
980
+ obj.qcacheSignature = message.qcacheSignature;
981
+ }
982
+ if (message.qcacheHit !== undefined) {
983
+ obj.qcacheHit = message.qcacheHit;
984
+ }
985
+ return obj;
986
+ },
987
+
988
+ create(base?: DeepPartial<QueryExecutionSummary>): QueryExecutionSummary {
989
+ return QueryExecutionSummary.fromPartial(base ?? {});
990
+ },
991
+ fromPartial(object: DeepPartial<QueryExecutionSummary>): QueryExecutionSummary {
992
+ const message = createBaseQueryExecutionSummary();
993
+ message.timeTookMs = object.timeTookMs ?? BigInt("0");
994
+ message.resultNumRows = object.resultNumRows ?? undefined;
995
+ message.resultNumBytes = object.resultNumBytes ?? undefined;
996
+ message.numPartitionsWithMaterializedView = object.numPartitionsWithMaterializedView ?? undefined;
997
+ message.numPartitionsWithoutMaterializedView = object.numPartitionsWithoutMaterializedView ?? undefined;
998
+ message.numPartitions = object.numPartitions ?? undefined;
999
+ message.phases = object.phases?.map((e) => QueryPhaseSummary.fromPartial(e)) || [];
1000
+ message.qcacheSignature = object.qcacheSignature ?? undefined;
1001
+ message.qcacheHit = object.qcacheHit ?? undefined;
1002
+ return message;
1003
+ },
1004
+ };
1005
+
1006
+ function createBaseAptosGetTxnsResponse(): AptosGetTxnsResponse {
1007
+ return { documents: [], executionSummary: undefined };
1008
+ }
1009
+
1010
+ export const AptosGetTxnsResponse = {
1011
+ encode(message: AptosGetTxnsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1012
+ for (const v of message.documents) {
1013
+ writer.uint32(10).bytes(v!);
1014
+ }
1015
+ if (message.executionSummary !== undefined) {
1016
+ QueryExecutionSummary.encode(message.executionSummary, writer.uint32(18).fork()).ldelim();
1017
+ }
1018
+ return writer;
1019
+ },
1020
+
1021
+ decode(input: _m0.Reader | Uint8Array, length?: number): AptosGetTxnsResponse {
1022
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1023
+ let end = length === undefined ? reader.len : reader.pos + length;
1024
+ const message = createBaseAptosGetTxnsResponse();
1025
+ while (reader.pos < end) {
1026
+ const tag = reader.uint32();
1027
+ switch (tag >>> 3) {
1028
+ case 1:
1029
+ if (tag !== 10) {
1030
+ break;
1031
+ }
1032
+
1033
+ message.documents.push(reader.bytes());
1034
+ continue;
1035
+ case 2:
1036
+ if (tag !== 18) {
1037
+ break;
1038
+ }
1039
+
1040
+ message.executionSummary = QueryExecutionSummary.decode(reader, reader.uint32());
1041
+ continue;
1042
+ }
1043
+ if ((tag & 7) === 4 || tag === 0) {
1044
+ break;
1045
+ }
1046
+ reader.skipType(tag & 7);
1047
+ }
1048
+ return message;
1049
+ },
1050
+
1051
+ fromJSON(object: any): AptosGetTxnsResponse {
1052
+ return {
1053
+ documents: globalThis.Array.isArray(object?.documents)
1054
+ ? object.documents.map((e: any) => bytesFromBase64(e))
1055
+ : [],
1056
+ executionSummary: isSet(object.executionSummary)
1057
+ ? QueryExecutionSummary.fromJSON(object.executionSummary)
1058
+ : undefined,
1059
+ };
1060
+ },
1061
+
1062
+ toJSON(message: AptosGetTxnsResponse): unknown {
1063
+ const obj: any = {};
1064
+ if (message.documents?.length) {
1065
+ obj.documents = message.documents.map((e) => base64FromBytes(e));
1066
+ }
1067
+ if (message.executionSummary !== undefined) {
1068
+ obj.executionSummary = QueryExecutionSummary.toJSON(message.executionSummary);
1069
+ }
1070
+ return obj;
1071
+ },
1072
+
1073
+ create(base?: DeepPartial<AptosGetTxnsResponse>): AptosGetTxnsResponse {
1074
+ return AptosGetTxnsResponse.fromPartial(base ?? {});
1075
+ },
1076
+ fromPartial(object: DeepPartial<AptosGetTxnsResponse>): AptosGetTxnsResponse {
1077
+ const message = createBaseAptosGetTxnsResponse();
1078
+ message.documents = object.documents?.map((e) => e) || [];
1079
+ message.executionSummary = (object.executionSummary !== undefined && object.executionSummary !== null)
1080
+ ? QueryExecutionSummary.fromPartial(object.executionSummary)
1081
+ : undefined;
1082
+ return message;
1083
+ },
1084
+ };
1085
+
1086
+ function createBaseAptosRefreshRequest(): AptosRefreshRequest {
1087
+ return {};
1088
+ }
1089
+
1090
+ export const AptosRefreshRequest = {
1091
+ encode(_: AptosRefreshRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1092
+ return writer;
1093
+ },
1094
+
1095
+ decode(input: _m0.Reader | Uint8Array, length?: number): AptosRefreshRequest {
1096
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1097
+ let end = length === undefined ? reader.len : reader.pos + length;
1098
+ const message = createBaseAptosRefreshRequest();
1099
+ while (reader.pos < end) {
1100
+ const tag = reader.uint32();
1101
+ switch (tag >>> 3) {
1102
+ }
1103
+ if ((tag & 7) === 4 || tag === 0) {
1104
+ break;
1105
+ }
1106
+ reader.skipType(tag & 7);
1107
+ }
1108
+ return message;
1109
+ },
1110
+
1111
+ fromJSON(_: any): AptosRefreshRequest {
1112
+ return {};
1113
+ },
1114
+
1115
+ toJSON(_: AptosRefreshRequest): unknown {
1116
+ const obj: any = {};
1117
+ return obj;
1118
+ },
1119
+
1120
+ create(base?: DeepPartial<AptosRefreshRequest>): AptosRefreshRequest {
1121
+ return AptosRefreshRequest.fromPartial(base ?? {});
1122
+ },
1123
+ fromPartial(_: DeepPartial<AptosRefreshRequest>): AptosRefreshRequest {
1124
+ const message = createBaseAptosRefreshRequest();
1125
+ return message;
1126
+ },
1127
+ };
1128
+
1129
+ function createBaseVoidResponse(): VoidResponse {
1130
+ return {};
1131
+ }
1132
+
1133
+ export const VoidResponse = {
1134
+ encode(_: VoidResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1135
+ return writer;
1136
+ },
1137
+
1138
+ decode(input: _m0.Reader | Uint8Array, length?: number): VoidResponse {
1139
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1140
+ let end = length === undefined ? reader.len : reader.pos + length;
1141
+ const message = createBaseVoidResponse();
1142
+ while (reader.pos < end) {
1143
+ const tag = reader.uint32();
1144
+ switch (tag >>> 3) {
1145
+ }
1146
+ if ((tag & 7) === 4 || tag === 0) {
1147
+ break;
1148
+ }
1149
+ reader.skipType(tag & 7);
1150
+ }
1151
+ return message;
1152
+ },
1153
+
1154
+ fromJSON(_: any): VoidResponse {
1155
+ return {};
1156
+ },
1157
+
1158
+ toJSON(_: VoidResponse): unknown {
1159
+ const obj: any = {};
1160
+ return obj;
1161
+ },
1162
+
1163
+ create(base?: DeepPartial<VoidResponse>): VoidResponse {
1164
+ return VoidResponse.fromPartial(base ?? {});
1165
+ },
1166
+ fromPartial(_: DeepPartial<VoidResponse>): VoidResponse {
1167
+ const message = createBaseVoidResponse();
1168
+ return message;
1169
+ },
1170
+ };
1171
+
1172
+ function createBaseEvmSQLQueryRequest(): EvmSQLQueryRequest {
1173
+ return { network: "", sql: "", nocache: undefined };
1174
+ }
1175
+
1176
+ export const EvmSQLQueryRequest = {
1177
+ encode(message: EvmSQLQueryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1178
+ if (message.network !== "") {
1179
+ writer.uint32(10).string(message.network);
1180
+ }
1181
+ if (message.sql !== "") {
1182
+ writer.uint32(18).string(message.sql);
1183
+ }
1184
+ if (message.nocache !== undefined) {
1185
+ writer.uint32(24).bool(message.nocache);
1186
+ }
1187
+ return writer;
1188
+ },
1189
+
1190
+ decode(input: _m0.Reader | Uint8Array, length?: number): EvmSQLQueryRequest {
1191
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1192
+ let end = length === undefined ? reader.len : reader.pos + length;
1193
+ const message = createBaseEvmSQLQueryRequest();
1194
+ while (reader.pos < end) {
1195
+ const tag = reader.uint32();
1196
+ switch (tag >>> 3) {
1197
+ case 1:
1198
+ if (tag !== 10) {
1199
+ break;
1200
+ }
1201
+
1202
+ message.network = reader.string();
1203
+ continue;
1204
+ case 2:
1205
+ if (tag !== 18) {
1206
+ break;
1207
+ }
1208
+
1209
+ message.sql = reader.string();
1210
+ continue;
1211
+ case 3:
1212
+ if (tag !== 24) {
1213
+ break;
1214
+ }
1215
+
1216
+ message.nocache = reader.bool();
1217
+ continue;
1218
+ }
1219
+ if ((tag & 7) === 4 || tag === 0) {
1220
+ break;
1221
+ }
1222
+ reader.skipType(tag & 7);
1223
+ }
1224
+ return message;
1225
+ },
1226
+
1227
+ fromJSON(object: any): EvmSQLQueryRequest {
1228
+ return {
1229
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
1230
+ sql: isSet(object.sql) ? globalThis.String(object.sql) : "",
1231
+ nocache: isSet(object.nocache) ? globalThis.Boolean(object.nocache) : undefined,
1232
+ };
1233
+ },
1234
+
1235
+ toJSON(message: EvmSQLQueryRequest): unknown {
1236
+ const obj: any = {};
1237
+ if (message.network !== "") {
1238
+ obj.network = message.network;
1239
+ }
1240
+ if (message.sql !== "") {
1241
+ obj.sql = message.sql;
1242
+ }
1243
+ if (message.nocache !== undefined) {
1244
+ obj.nocache = message.nocache;
1245
+ }
1246
+ return obj;
1247
+ },
1248
+
1249
+ create(base?: DeepPartial<EvmSQLQueryRequest>): EvmSQLQueryRequest {
1250
+ return EvmSQLQueryRequest.fromPartial(base ?? {});
1251
+ },
1252
+ fromPartial(object: DeepPartial<EvmSQLQueryRequest>): EvmSQLQueryRequest {
1253
+ const message = createBaseEvmSQLQueryRequest();
1254
+ message.network = object.network ?? "";
1255
+ message.sql = object.sql ?? "";
1256
+ message.nocache = object.nocache ?? undefined;
1257
+ return message;
1258
+ },
1259
+ };
1260
+
1261
+ function createBaseEvmGetHeaderRequest(): EvmGetHeaderRequest {
1262
+ return { network: "", fromBlock: undefined, toBlock: undefined, blockNumbers: [] };
1263
+ }
1264
+
1265
+ export const EvmGetHeaderRequest = {
1266
+ encode(message: EvmGetHeaderRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1267
+ if (message.network !== "") {
1268
+ writer.uint32(10).string(message.network);
1269
+ }
1270
+ if (message.fromBlock !== undefined) {
1271
+ if (BigInt.asUintN(64, message.fromBlock) !== message.fromBlock) {
1272
+ throw new globalThis.Error("value provided for field message.fromBlock of type uint64 too large");
1273
+ }
1274
+ writer.uint32(16).uint64(message.fromBlock.toString());
1275
+ }
1276
+ if (message.toBlock !== undefined) {
1277
+ if (BigInt.asUintN(64, message.toBlock) !== message.toBlock) {
1278
+ throw new globalThis.Error("value provided for field message.toBlock of type uint64 too large");
1279
+ }
1280
+ writer.uint32(24).uint64(message.toBlock.toString());
1281
+ }
1282
+ writer.uint32(34).fork();
1283
+ for (const v of message.blockNumbers) {
1284
+ if (BigInt.asUintN(64, v) !== v) {
1285
+ throw new globalThis.Error("a value provided in array field blockNumbers of type uint64 is too large");
1286
+ }
1287
+ writer.uint64(v.toString());
1288
+ }
1289
+ writer.ldelim();
1290
+ return writer;
1291
+ },
1292
+
1293
+ decode(input: _m0.Reader | Uint8Array, length?: number): EvmGetHeaderRequest {
1294
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1295
+ let end = length === undefined ? reader.len : reader.pos + length;
1296
+ const message = createBaseEvmGetHeaderRequest();
1297
+ while (reader.pos < end) {
1298
+ const tag = reader.uint32();
1299
+ switch (tag >>> 3) {
1300
+ case 1:
1301
+ if (tag !== 10) {
1302
+ break;
1303
+ }
1304
+
1305
+ message.network = reader.string();
1306
+ continue;
1307
+ case 2:
1308
+ if (tag !== 16) {
1309
+ break;
1310
+ }
1311
+
1312
+ message.fromBlock = longToBigint(reader.uint64() as Long);
1313
+ continue;
1314
+ case 3:
1315
+ if (tag !== 24) {
1316
+ break;
1317
+ }
1318
+
1319
+ message.toBlock = longToBigint(reader.uint64() as Long);
1320
+ continue;
1321
+ case 4:
1322
+ if (tag === 32) {
1323
+ message.blockNumbers.push(longToBigint(reader.uint64() as Long));
1324
+
1325
+ continue;
1326
+ }
1327
+
1328
+ if (tag === 34) {
1329
+ const end2 = reader.uint32() + reader.pos;
1330
+ while (reader.pos < end2) {
1331
+ message.blockNumbers.push(longToBigint(reader.uint64() as Long));
1332
+ }
1333
+
1334
+ continue;
1335
+ }
1336
+
1337
+ break;
1338
+ }
1339
+ if ((tag & 7) === 4 || tag === 0) {
1340
+ break;
1341
+ }
1342
+ reader.skipType(tag & 7);
1343
+ }
1344
+ return message;
1345
+ },
1346
+
1347
+ fromJSON(object: any): EvmGetHeaderRequest {
1348
+ return {
1349
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
1350
+ fromBlock: isSet(object.fromBlock) ? BigInt(object.fromBlock) : undefined,
1351
+ toBlock: isSet(object.toBlock) ? BigInt(object.toBlock) : undefined,
1352
+ blockNumbers: globalThis.Array.isArray(object?.blockNumbers)
1353
+ ? object.blockNumbers.map((e: any) => BigInt(e))
1354
+ : [],
1355
+ };
1356
+ },
1357
+
1358
+ toJSON(message: EvmGetHeaderRequest): unknown {
1359
+ const obj: any = {};
1360
+ if (message.network !== "") {
1361
+ obj.network = message.network;
1362
+ }
1363
+ if (message.fromBlock !== undefined) {
1364
+ obj.fromBlock = message.fromBlock.toString();
1365
+ }
1366
+ if (message.toBlock !== undefined) {
1367
+ obj.toBlock = message.toBlock.toString();
1368
+ }
1369
+ if (message.blockNumbers?.length) {
1370
+ obj.blockNumbers = message.blockNumbers.map((e) => e.toString());
1371
+ }
1372
+ return obj;
1373
+ },
1374
+
1375
+ create(base?: DeepPartial<EvmGetHeaderRequest>): EvmGetHeaderRequest {
1376
+ return EvmGetHeaderRequest.fromPartial(base ?? {});
1377
+ },
1378
+ fromPartial(object: DeepPartial<EvmGetHeaderRequest>): EvmGetHeaderRequest {
1379
+ const message = createBaseEvmGetHeaderRequest();
1380
+ message.network = object.network ?? "";
1381
+ message.fromBlock = object.fromBlock ?? undefined;
1382
+ message.toBlock = object.toBlock ?? undefined;
1383
+ message.blockNumbers = object.blockNumbers?.map((e) => e) || [];
1384
+ return message;
1385
+ },
1386
+ };
1387
+
1388
+ function createBaseEvmQueryResponse(): EvmQueryResponse {
1389
+ return { rows: [], executionSummary: undefined };
1390
+ }
1391
+
1392
+ export const EvmQueryResponse = {
1393
+ encode(message: EvmQueryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1394
+ for (const v of message.rows) {
1395
+ writer.uint32(10).bytes(v!);
1396
+ }
1397
+ if (message.executionSummary !== undefined) {
1398
+ QueryExecutionSummary.encode(message.executionSummary, writer.uint32(18).fork()).ldelim();
1399
+ }
1400
+ return writer;
1401
+ },
1402
+
1403
+ decode(input: _m0.Reader | Uint8Array, length?: number): EvmQueryResponse {
1404
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1405
+ let end = length === undefined ? reader.len : reader.pos + length;
1406
+ const message = createBaseEvmQueryResponse();
1407
+ while (reader.pos < end) {
1408
+ const tag = reader.uint32();
1409
+ switch (tag >>> 3) {
1410
+ case 1:
1411
+ if (tag !== 10) {
1412
+ break;
1413
+ }
1414
+
1415
+ message.rows.push(reader.bytes());
1416
+ continue;
1417
+ case 2:
1418
+ if (tag !== 18) {
1419
+ break;
1420
+ }
1421
+
1422
+ message.executionSummary = QueryExecutionSummary.decode(reader, reader.uint32());
1423
+ continue;
1424
+ }
1425
+ if ((tag & 7) === 4 || tag === 0) {
1426
+ break;
1427
+ }
1428
+ reader.skipType(tag & 7);
1429
+ }
1430
+ return message;
1431
+ },
1432
+
1433
+ fromJSON(object: any): EvmQueryResponse {
1434
+ return {
1435
+ rows: globalThis.Array.isArray(object?.rows) ? object.rows.map((e: any) => bytesFromBase64(e)) : [],
1436
+ executionSummary: isSet(object.executionSummary)
1437
+ ? QueryExecutionSummary.fromJSON(object.executionSummary)
1438
+ : undefined,
1439
+ };
1440
+ },
1441
+
1442
+ toJSON(message: EvmQueryResponse): unknown {
1443
+ const obj: any = {};
1444
+ if (message.rows?.length) {
1445
+ obj.rows = message.rows.map((e) => base64FromBytes(e));
1446
+ }
1447
+ if (message.executionSummary !== undefined) {
1448
+ obj.executionSummary = QueryExecutionSummary.toJSON(message.executionSummary);
1449
+ }
1450
+ return obj;
1451
+ },
1452
+
1453
+ create(base?: DeepPartial<EvmQueryResponse>): EvmQueryResponse {
1454
+ return EvmQueryResponse.fromPartial(base ?? {});
1455
+ },
1456
+ fromPartial(object: DeepPartial<EvmQueryResponse>): EvmQueryResponse {
1457
+ const message = createBaseEvmQueryResponse();
1458
+ message.rows = object.rows?.map((e) => e) || [];
1459
+ message.executionSummary = (object.executionSummary !== undefined && object.executionSummary !== null)
1460
+ ? QueryExecutionSummary.fromPartial(object.executionSummary)
1461
+ : undefined;
1462
+ return message;
1463
+ },
1464
+ };
1465
+
1466
+ function createBaseSuiGetCheckpointTimeRequest(): SuiGetCheckpointTimeRequest {
1467
+ return { network: "", checkpointSequenceNumber: BigInt("0") };
1468
+ }
1469
+
1470
+ export const SuiGetCheckpointTimeRequest = {
1471
+ encode(message: SuiGetCheckpointTimeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1472
+ if (message.network !== "") {
1473
+ writer.uint32(10).string(message.network);
1474
+ }
1475
+ if (message.checkpointSequenceNumber !== BigInt("0")) {
1476
+ if (BigInt.asUintN(64, message.checkpointSequenceNumber) !== message.checkpointSequenceNumber) {
1477
+ throw new globalThis.Error(
1478
+ "value provided for field message.checkpointSequenceNumber of type uint64 too large",
1479
+ );
1480
+ }
1481
+ writer.uint32(16).uint64(message.checkpointSequenceNumber.toString());
1482
+ }
1483
+ return writer;
1484
+ },
1485
+
1486
+ decode(input: _m0.Reader | Uint8Array, length?: number): SuiGetCheckpointTimeRequest {
1487
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1488
+ let end = length === undefined ? reader.len : reader.pos + length;
1489
+ const message = createBaseSuiGetCheckpointTimeRequest();
1490
+ while (reader.pos < end) {
1491
+ const tag = reader.uint32();
1492
+ switch (tag >>> 3) {
1493
+ case 1:
1494
+ if (tag !== 10) {
1495
+ break;
1496
+ }
1497
+
1498
+ message.network = reader.string();
1499
+ continue;
1500
+ case 2:
1501
+ if (tag !== 16) {
1502
+ break;
1503
+ }
1504
+
1505
+ message.checkpointSequenceNumber = longToBigint(reader.uint64() as Long);
1506
+ continue;
1507
+ }
1508
+ if ((tag & 7) === 4 || tag === 0) {
1509
+ break;
1510
+ }
1511
+ reader.skipType(tag & 7);
1512
+ }
1513
+ return message;
1514
+ },
1515
+
1516
+ fromJSON(object: any): SuiGetCheckpointTimeRequest {
1517
+ return {
1518
+ network: isSet(object.network) ? globalThis.String(object.network) : "",
1519
+ checkpointSequenceNumber: isSet(object.checkpointSequenceNumber)
1520
+ ? BigInt(object.checkpointSequenceNumber)
1521
+ : BigInt("0"),
1522
+ };
1523
+ },
1524
+
1525
+ toJSON(message: SuiGetCheckpointTimeRequest): unknown {
1526
+ const obj: any = {};
1527
+ if (message.network !== "") {
1528
+ obj.network = message.network;
1529
+ }
1530
+ if (message.checkpointSequenceNumber !== BigInt("0")) {
1531
+ obj.checkpointSequenceNumber = message.checkpointSequenceNumber.toString();
1532
+ }
1533
+ return obj;
1534
+ },
1535
+
1536
+ create(base?: DeepPartial<SuiGetCheckpointTimeRequest>): SuiGetCheckpointTimeRequest {
1537
+ return SuiGetCheckpointTimeRequest.fromPartial(base ?? {});
1538
+ },
1539
+ fromPartial(object: DeepPartial<SuiGetCheckpointTimeRequest>): SuiGetCheckpointTimeRequest {
1540
+ const message = createBaseSuiGetCheckpointTimeRequest();
1541
+ message.network = object.network ?? "";
1542
+ message.checkpointSequenceNumber = object.checkpointSequenceNumber ?? BigInt("0");
1543
+ return message;
1544
+ },
1545
+ };
1546
+
1547
+ function createBaseSuiGetCheckpointTimeResponse(): SuiGetCheckpointTimeResponse {
1548
+ return {
1549
+ checkpointTimestampMs: undefined,
1550
+ transactionMinTimestampMs: undefined,
1551
+ transactionMaxTimestampMs: undefined,
1552
+ };
1553
+ }
1554
+
1555
+ export const SuiGetCheckpointTimeResponse = {
1556
+ encode(message: SuiGetCheckpointTimeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1557
+ if (message.checkpointTimestampMs !== undefined) {
1558
+ if (BigInt.asUintN(64, message.checkpointTimestampMs) !== message.checkpointTimestampMs) {
1559
+ throw new globalThis.Error("value provided for field message.checkpointTimestampMs of type uint64 too large");
1560
+ }
1561
+ writer.uint32(8).uint64(message.checkpointTimestampMs.toString());
1562
+ }
1563
+ if (message.transactionMinTimestampMs !== undefined) {
1564
+ if (BigInt.asUintN(64, message.transactionMinTimestampMs) !== message.transactionMinTimestampMs) {
1565
+ throw new globalThis.Error(
1566
+ "value provided for field message.transactionMinTimestampMs of type uint64 too large",
1567
+ );
1568
+ }
1569
+ writer.uint32(16).uint64(message.transactionMinTimestampMs.toString());
1570
+ }
1571
+ if (message.transactionMaxTimestampMs !== undefined) {
1572
+ if (BigInt.asUintN(64, message.transactionMaxTimestampMs) !== message.transactionMaxTimestampMs) {
1573
+ throw new globalThis.Error(
1574
+ "value provided for field message.transactionMaxTimestampMs of type uint64 too large",
1575
+ );
1576
+ }
1577
+ writer.uint32(24).uint64(message.transactionMaxTimestampMs.toString());
1578
+ }
1579
+ return writer;
1580
+ },
1581
+
1582
+ decode(input: _m0.Reader | Uint8Array, length?: number): SuiGetCheckpointTimeResponse {
1583
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1584
+ let end = length === undefined ? reader.len : reader.pos + length;
1585
+ const message = createBaseSuiGetCheckpointTimeResponse();
1586
+ while (reader.pos < end) {
1587
+ const tag = reader.uint32();
1588
+ switch (tag >>> 3) {
1589
+ case 1:
1590
+ if (tag !== 8) {
1591
+ break;
1592
+ }
1593
+
1594
+ message.checkpointTimestampMs = longToBigint(reader.uint64() as Long);
1595
+ continue;
1596
+ case 2:
1597
+ if (tag !== 16) {
1598
+ break;
1599
+ }
1600
+
1601
+ message.transactionMinTimestampMs = longToBigint(reader.uint64() as Long);
1602
+ continue;
1603
+ case 3:
1604
+ if (tag !== 24) {
1605
+ break;
1606
+ }
1607
+
1608
+ message.transactionMaxTimestampMs = longToBigint(reader.uint64() as Long);
1609
+ continue;
1610
+ }
1611
+ if ((tag & 7) === 4 || tag === 0) {
1612
+ break;
1613
+ }
1614
+ reader.skipType(tag & 7);
1615
+ }
1616
+ return message;
1617
+ },
1618
+
1619
+ fromJSON(object: any): SuiGetCheckpointTimeResponse {
1620
+ return {
1621
+ checkpointTimestampMs: isSet(object.checkpointTimestampMs) ? BigInt(object.checkpointTimestampMs) : undefined,
1622
+ transactionMinTimestampMs: isSet(object.transactionMinTimestampMs)
1623
+ ? BigInt(object.transactionMinTimestampMs)
1624
+ : undefined,
1625
+ transactionMaxTimestampMs: isSet(object.transactionMaxTimestampMs)
1626
+ ? BigInt(object.transactionMaxTimestampMs)
1627
+ : undefined,
1628
+ };
1629
+ },
1630
+
1631
+ toJSON(message: SuiGetCheckpointTimeResponse): unknown {
1632
+ const obj: any = {};
1633
+ if (message.checkpointTimestampMs !== undefined) {
1634
+ obj.checkpointTimestampMs = message.checkpointTimestampMs.toString();
1635
+ }
1636
+ if (message.transactionMinTimestampMs !== undefined) {
1637
+ obj.transactionMinTimestampMs = message.transactionMinTimestampMs.toString();
1638
+ }
1639
+ if (message.transactionMaxTimestampMs !== undefined) {
1640
+ obj.transactionMaxTimestampMs = message.transactionMaxTimestampMs.toString();
1641
+ }
1642
+ return obj;
1643
+ },
1644
+
1645
+ create(base?: DeepPartial<SuiGetCheckpointTimeResponse>): SuiGetCheckpointTimeResponse {
1646
+ return SuiGetCheckpointTimeResponse.fromPartial(base ?? {});
1647
+ },
1648
+ fromPartial(object: DeepPartial<SuiGetCheckpointTimeResponse>): SuiGetCheckpointTimeResponse {
1649
+ const message = createBaseSuiGetCheckpointTimeResponse();
1650
+ message.checkpointTimestampMs = object.checkpointTimestampMs ?? undefined;
1651
+ message.transactionMinTimestampMs = object.transactionMinTimestampMs ?? undefined;
1652
+ message.transactionMaxTimestampMs = object.transactionMaxTimestampMs ?? undefined;
1653
+ return message;
1654
+ },
1655
+ };
1656
+
1657
+ function createBaseRemoteResultRequest(): RemoteResultRequest {
1658
+ return { token: "", position: 0, keepAlive: false };
1659
+ }
1660
+
1661
+ export const RemoteResultRequest = {
1662
+ encode(message: RemoteResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1663
+ if (message.token !== "") {
1664
+ writer.uint32(10).string(message.token);
1665
+ }
1666
+ if (message.position !== 0) {
1667
+ writer.uint32(16).int32(message.position);
1668
+ }
1669
+ if (message.keepAlive !== false) {
1670
+ writer.uint32(24).bool(message.keepAlive);
1671
+ }
1672
+ return writer;
1673
+ },
1674
+
1675
+ decode(input: _m0.Reader | Uint8Array, length?: number): RemoteResultRequest {
1676
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1677
+ let end = length === undefined ? reader.len : reader.pos + length;
1678
+ const message = createBaseRemoteResultRequest();
1679
+ while (reader.pos < end) {
1680
+ const tag = reader.uint32();
1681
+ switch (tag >>> 3) {
1682
+ case 1:
1683
+ if (tag !== 10) {
1684
+ break;
1685
+ }
1686
+
1687
+ message.token = reader.string();
1688
+ continue;
1689
+ case 2:
1690
+ if (tag !== 16) {
1691
+ break;
1692
+ }
1693
+
1694
+ message.position = reader.int32();
1695
+ continue;
1696
+ case 3:
1697
+ if (tag !== 24) {
1698
+ break;
1699
+ }
1700
+
1701
+ message.keepAlive = reader.bool();
1702
+ continue;
1703
+ }
1704
+ if ((tag & 7) === 4 || tag === 0) {
1705
+ break;
1706
+ }
1707
+ reader.skipType(tag & 7);
1708
+ }
1709
+ return message;
1710
+ },
1711
+
1712
+ fromJSON(object: any): RemoteResultRequest {
1713
+ return {
1714
+ token: isSet(object.token) ? globalThis.String(object.token) : "",
1715
+ position: isSet(object.position) ? globalThis.Number(object.position) : 0,
1716
+ keepAlive: isSet(object.keepAlive) ? globalThis.Boolean(object.keepAlive) : false,
1717
+ };
1718
+ },
1719
+
1720
+ toJSON(message: RemoteResultRequest): unknown {
1721
+ const obj: any = {};
1722
+ if (message.token !== "") {
1723
+ obj.token = message.token;
1724
+ }
1725
+ if (message.position !== 0) {
1726
+ obj.position = Math.round(message.position);
1727
+ }
1728
+ if (message.keepAlive !== false) {
1729
+ obj.keepAlive = message.keepAlive;
1730
+ }
1731
+ return obj;
1732
+ },
1733
+
1734
+ create(base?: DeepPartial<RemoteResultRequest>): RemoteResultRequest {
1735
+ return RemoteResultRequest.fromPartial(base ?? {});
1736
+ },
1737
+ fromPartial(object: DeepPartial<RemoteResultRequest>): RemoteResultRequest {
1738
+ const message = createBaseRemoteResultRequest();
1739
+ message.token = object.token ?? "";
1740
+ message.position = object.position ?? 0;
1741
+ message.keepAlive = object.keepAlive ?? false;
1742
+ return message;
1743
+ },
1744
+ };
1745
+
1746
+ function createBaseRemoteResultResponse(): RemoteResultResponse {
1747
+ return { rows: [] };
1748
+ }
1749
+
1750
+ export const RemoteResultResponse = {
1751
+ encode(message: RemoteResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1752
+ for (const v of message.rows) {
1753
+ writer.uint32(10).bytes(v!);
1754
+ }
1755
+ return writer;
1756
+ },
1757
+
1758
+ decode(input: _m0.Reader | Uint8Array, length?: number): RemoteResultResponse {
1759
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1760
+ let end = length === undefined ? reader.len : reader.pos + length;
1761
+ const message = createBaseRemoteResultResponse();
1762
+ while (reader.pos < end) {
1763
+ const tag = reader.uint32();
1764
+ switch (tag >>> 3) {
1765
+ case 1:
1766
+ if (tag !== 10) {
1767
+ break;
1768
+ }
1769
+
1770
+ message.rows.push(reader.bytes());
1771
+ continue;
1772
+ }
1773
+ if ((tag & 7) === 4 || tag === 0) {
1774
+ break;
1775
+ }
1776
+ reader.skipType(tag & 7);
1777
+ }
1778
+ return message;
1779
+ },
1780
+
1781
+ fromJSON(object: any): RemoteResultResponse {
1782
+ return { rows: globalThis.Array.isArray(object?.rows) ? object.rows.map((e: any) => bytesFromBase64(e)) : [] };
1783
+ },
1784
+
1785
+ toJSON(message: RemoteResultResponse): unknown {
1786
+ const obj: any = {};
1787
+ if (message.rows?.length) {
1788
+ obj.rows = message.rows.map((e) => base64FromBytes(e));
1789
+ }
1790
+ return obj;
1791
+ },
1792
+
1793
+ create(base?: DeepPartial<RemoteResultResponse>): RemoteResultResponse {
1794
+ return RemoteResultResponse.fromPartial(base ?? {});
1795
+ },
1796
+ fromPartial(object: DeepPartial<RemoteResultResponse>): RemoteResultResponse {
1797
+ const message = createBaseRemoteResultResponse();
1798
+ message.rows = object.rows?.map((e) => e) || [];
1799
+ return message;
1800
+ },
1801
+ };
1802
+
1803
+ export type AptosQueryDefinition = typeof AptosQueryDefinition;
1804
+ export const AptosQueryDefinition = {
1805
+ name: "AptosQuery",
1806
+ fullName: "chainquery.AptosQuery",
1807
+ methods: {
1808
+ aptosGetTxnsByFunction: {
1809
+ name: "AptosGetTxnsByFunction",
1810
+ requestType: AptosGetTxnsByFunctionRequest,
1811
+ requestStream: false,
1812
+ responseType: AptosGetTxnsResponse,
1813
+ responseStream: false,
1814
+ options: {},
1815
+ },
1816
+ aptosGetTxnsByFunctionStream: {
1817
+ name: "AptosGetTxnsByFunctionStream",
1818
+ requestType: AptosGetTxnsByFunctionRequest,
1819
+ requestStream: false,
1820
+ responseType: AptosGetTxnsResponse,
1821
+ responseStream: true,
1822
+ options: {},
1823
+ },
1824
+ aptosGetTxnsByVersion: {
1825
+ name: "AptosGetTxnsByVersion",
1826
+ requestType: AptosGetTxnsByVersionRequest,
1827
+ requestStream: false,
1828
+ responseType: AptosGetTxnsResponse,
1829
+ responseStream: false,
1830
+ options: {},
1831
+ },
1832
+ aptosGetTxnsByEvent: {
1833
+ name: "AptosGetTxnsByEvent",
1834
+ requestType: AptosGetTxnsByEventRequest,
1835
+ requestStream: false,
1836
+ responseType: AptosGetTxnsResponse,
1837
+ responseStream: false,
1838
+ options: {},
1839
+ },
1840
+ aptosGetTxnsByEventStream: {
1841
+ name: "AptosGetTxnsByEventStream",
1842
+ requestType: AptosGetTxnsByEventRequest,
1843
+ requestStream: false,
1844
+ responseType: AptosGetTxnsResponse,
1845
+ responseStream: true,
1846
+ options: {},
1847
+ },
1848
+ aptosRefresh: {
1849
+ name: "AptosRefresh",
1850
+ requestType: AptosRefreshRequest,
1851
+ requestStream: false,
1852
+ responseType: VoidResponse,
1853
+ responseStream: false,
1854
+ options: {},
1855
+ },
1856
+ aptosSQLQuery: {
1857
+ name: "AptosSQLQuery",
1858
+ requestType: AptosSQLQueryRequest,
1859
+ requestStream: false,
1860
+ responseType: AptosGetTxnsResponse,
1861
+ responseStream: false,
1862
+ options: {},
1863
+ },
1864
+ },
1865
+ } as const;
1866
+
1867
+ export interface AptosQueryServiceImplementation<CallContextExt = {}> {
1868
+ aptosGetTxnsByFunction(
1869
+ request: AptosGetTxnsByFunctionRequest,
1870
+ context: CallContext & CallContextExt,
1871
+ ): Promise<DeepPartial<AptosGetTxnsResponse>>;
1872
+ aptosGetTxnsByFunctionStream(
1873
+ request: AptosGetTxnsByFunctionRequest,
1874
+ context: CallContext & CallContextExt,
1875
+ ): ServerStreamingMethodResult<DeepPartial<AptosGetTxnsResponse>>;
1876
+ aptosGetTxnsByVersion(
1877
+ request: AptosGetTxnsByVersionRequest,
1878
+ context: CallContext & CallContextExt,
1879
+ ): Promise<DeepPartial<AptosGetTxnsResponse>>;
1880
+ aptosGetTxnsByEvent(
1881
+ request: AptosGetTxnsByEventRequest,
1882
+ context: CallContext & CallContextExt,
1883
+ ): Promise<DeepPartial<AptosGetTxnsResponse>>;
1884
+ aptosGetTxnsByEventStream(
1885
+ request: AptosGetTxnsByEventRequest,
1886
+ context: CallContext & CallContextExt,
1887
+ ): ServerStreamingMethodResult<DeepPartial<AptosGetTxnsResponse>>;
1888
+ aptosRefresh(request: AptosRefreshRequest, context: CallContext & CallContextExt): Promise<DeepPartial<VoidResponse>>;
1889
+ aptosSQLQuery(
1890
+ request: AptosSQLQueryRequest,
1891
+ context: CallContext & CallContextExt,
1892
+ ): Promise<DeepPartial<AptosGetTxnsResponse>>;
1893
+ }
1894
+
1895
+ export interface AptosQueryClient<CallOptionsExt = {}> {
1896
+ aptosGetTxnsByFunction(
1897
+ request: DeepPartial<AptosGetTxnsByFunctionRequest>,
1898
+ options?: CallOptions & CallOptionsExt,
1899
+ ): Promise<AptosGetTxnsResponse>;
1900
+ aptosGetTxnsByFunctionStream(
1901
+ request: DeepPartial<AptosGetTxnsByFunctionRequest>,
1902
+ options?: CallOptions & CallOptionsExt,
1903
+ ): AsyncIterable<AptosGetTxnsResponse>;
1904
+ aptosGetTxnsByVersion(
1905
+ request: DeepPartial<AptosGetTxnsByVersionRequest>,
1906
+ options?: CallOptions & CallOptionsExt,
1907
+ ): Promise<AptosGetTxnsResponse>;
1908
+ aptosGetTxnsByEvent(
1909
+ request: DeepPartial<AptosGetTxnsByEventRequest>,
1910
+ options?: CallOptions & CallOptionsExt,
1911
+ ): Promise<AptosGetTxnsResponse>;
1912
+ aptosGetTxnsByEventStream(
1913
+ request: DeepPartial<AptosGetTxnsByEventRequest>,
1914
+ options?: CallOptions & CallOptionsExt,
1915
+ ): AsyncIterable<AptosGetTxnsResponse>;
1916
+ aptosRefresh(
1917
+ request: DeepPartial<AptosRefreshRequest>,
1918
+ options?: CallOptions & CallOptionsExt,
1919
+ ): Promise<VoidResponse>;
1920
+ aptosSQLQuery(
1921
+ request: DeepPartial<AptosSQLQueryRequest>,
1922
+ options?: CallOptions & CallOptionsExt,
1923
+ ): Promise<AptosGetTxnsResponse>;
1924
+ }
1925
+
1926
+ export type EvmQueryDefinition = typeof EvmQueryDefinition;
1927
+ export const EvmQueryDefinition = {
1928
+ name: "EvmQuery",
1929
+ fullName: "chainquery.EvmQuery",
1930
+ methods: {
1931
+ evmSQLQuery: {
1932
+ name: "EvmSQLQuery",
1933
+ requestType: EvmSQLQueryRequest,
1934
+ requestStream: false,
1935
+ responseType: EvmQueryResponse,
1936
+ responseStream: true,
1937
+ options: {},
1938
+ },
1939
+ evmGetHeader: {
1940
+ name: "EvmGetHeader",
1941
+ requestType: EvmGetHeaderRequest,
1942
+ requestStream: false,
1943
+ responseType: EvmQueryResponse,
1944
+ responseStream: false,
1945
+ options: {},
1946
+ },
1947
+ evmHintHeaderCache: {
1948
+ name: "EvmHintHeaderCache",
1949
+ requestType: EvmGetHeaderRequest,
1950
+ requestStream: false,
1951
+ responseType: VoidResponse,
1952
+ responseStream: false,
1953
+ options: {},
1954
+ },
1955
+ },
1956
+ } as const;
1957
+
1958
+ export interface EvmQueryServiceImplementation<CallContextExt = {}> {
1959
+ evmSQLQuery(
1960
+ request: EvmSQLQueryRequest,
1961
+ context: CallContext & CallContextExt,
1962
+ ): ServerStreamingMethodResult<DeepPartial<EvmQueryResponse>>;
1963
+ evmGetHeader(
1964
+ request: EvmGetHeaderRequest,
1965
+ context: CallContext & CallContextExt,
1966
+ ): Promise<DeepPartial<EvmQueryResponse>>;
1967
+ evmHintHeaderCache(
1968
+ request: EvmGetHeaderRequest,
1969
+ context: CallContext & CallContextExt,
1970
+ ): Promise<DeepPartial<VoidResponse>>;
1971
+ }
1972
+
1973
+ export interface EvmQueryClient<CallOptionsExt = {}> {
1974
+ evmSQLQuery(
1975
+ request: DeepPartial<EvmSQLQueryRequest>,
1976
+ options?: CallOptions & CallOptionsExt,
1977
+ ): AsyncIterable<EvmQueryResponse>;
1978
+ evmGetHeader(
1979
+ request: DeepPartial<EvmGetHeaderRequest>,
1980
+ options?: CallOptions & CallOptionsExt,
1981
+ ): Promise<EvmQueryResponse>;
1982
+ evmHintHeaderCache(
1983
+ request: DeepPartial<EvmGetHeaderRequest>,
1984
+ options?: CallOptions & CallOptionsExt,
1985
+ ): Promise<VoidResponse>;
1986
+ }
1987
+
1988
+ export type SuiQueryDefinition = typeof SuiQueryDefinition;
1989
+ export const SuiQueryDefinition = {
1990
+ name: "SuiQuery",
1991
+ fullName: "chainquery.SuiQuery",
1992
+ methods: {
1993
+ suiSQLQuery: {
1994
+ name: "SuiSQLQuery",
1995
+ requestType: EvmSQLQueryRequest,
1996
+ requestStream: false,
1997
+ responseType: EvmQueryResponse,
1998
+ responseStream: true,
1999
+ options: {},
2000
+ },
2001
+ getCheckpointTime: {
2002
+ name: "GetCheckpointTime",
2003
+ requestType: SuiGetCheckpointTimeRequest,
2004
+ requestStream: false,
2005
+ responseType: SuiGetCheckpointTimeResponse,
2006
+ responseStream: false,
2007
+ options: {},
2008
+ },
2009
+ },
2010
+ } as const;
2011
+
2012
+ export interface SuiQueryServiceImplementation<CallContextExt = {}> {
2013
+ suiSQLQuery(
2014
+ request: EvmSQLQueryRequest,
2015
+ context: CallContext & CallContextExt,
2016
+ ): ServerStreamingMethodResult<DeepPartial<EvmQueryResponse>>;
2017
+ getCheckpointTime(
2018
+ request: SuiGetCheckpointTimeRequest,
2019
+ context: CallContext & CallContextExt,
2020
+ ): Promise<DeepPartial<SuiGetCheckpointTimeResponse>>;
2021
+ }
2022
+
2023
+ export interface SuiQueryClient<CallOptionsExt = {}> {
2024
+ suiSQLQuery(
2025
+ request: DeepPartial<EvmSQLQueryRequest>,
2026
+ options?: CallOptions & CallOptionsExt,
2027
+ ): AsyncIterable<EvmQueryResponse>;
2028
+ getCheckpointTime(
2029
+ request: DeepPartial<SuiGetCheckpointTimeRequest>,
2030
+ options?: CallOptions & CallOptionsExt,
2031
+ ): Promise<SuiGetCheckpointTimeResponse>;
2032
+ }
2033
+
2034
+ export type RemoteResultTransferServiceDefinition = typeof RemoteResultTransferServiceDefinition;
2035
+ export const RemoteResultTransferServiceDefinition = {
2036
+ name: "RemoteResultTransferService",
2037
+ fullName: "chainquery.RemoteResultTransferService",
2038
+ methods: {
2039
+ getResult: {
2040
+ name: "GetResult",
2041
+ requestType: RemoteResultRequest,
2042
+ requestStream: false,
2043
+ responseType: RemoteResultResponse,
2044
+ responseStream: false,
2045
+ options: {},
2046
+ },
2047
+ destroyResult: {
2048
+ name: "DestroyResult",
2049
+ requestType: RemoteResultRequest,
2050
+ requestStream: false,
2051
+ responseType: VoidResponse,
2052
+ responseStream: false,
2053
+ options: {},
2054
+ },
2055
+ },
2056
+ } as const;
2057
+
2058
+ export interface RemoteResultTransferServiceImplementation<CallContextExt = {}> {
2059
+ getResult(
2060
+ request: RemoteResultRequest,
2061
+ context: CallContext & CallContextExt,
2062
+ ): Promise<DeepPartial<RemoteResultResponse>>;
2063
+ destroyResult(
2064
+ request: RemoteResultRequest,
2065
+ context: CallContext & CallContextExt,
2066
+ ): Promise<DeepPartial<VoidResponse>>;
2067
+ }
2068
+
2069
+ export interface RemoteResultTransferServiceClient<CallOptionsExt = {}> {
2070
+ getResult(
2071
+ request: DeepPartial<RemoteResultRequest>,
2072
+ options?: CallOptions & CallOptionsExt,
2073
+ ): Promise<RemoteResultResponse>;
2074
+ destroyResult(
2075
+ request: DeepPartial<RemoteResultRequest>,
2076
+ options?: CallOptions & CallOptionsExt,
2077
+ ): Promise<VoidResponse>;
2078
+ }
2079
+
2080
+ function bytesFromBase64(b64: string): Uint8Array {
2081
+ if ((globalThis as any).Buffer) {
2082
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
2083
+ } else {
2084
+ const bin = globalThis.atob(b64);
2085
+ const arr = new Uint8Array(bin.length);
2086
+ for (let i = 0; i < bin.length; ++i) {
2087
+ arr[i] = bin.charCodeAt(i);
2088
+ }
2089
+ return arr;
2090
+ }
2091
+ }
2092
+
2093
+ function base64FromBytes(arr: Uint8Array): string {
2094
+ if ((globalThis as any).Buffer) {
2095
+ return globalThis.Buffer.from(arr).toString("base64");
2096
+ } else {
2097
+ const bin: string[] = [];
2098
+ arr.forEach((byte) => {
2099
+ bin.push(globalThis.String.fromCharCode(byte));
2100
+ });
2101
+ return globalThis.btoa(bin.join(""));
2102
+ }
2103
+ }
2104
+
2105
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
2106
+
2107
+ type DeepPartial<T> = T extends Builtin ? T
2108
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
2109
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
2110
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
2111
+ : Partial<T>;
2112
+
2113
+ function longToBigint(long: Long) {
2114
+ return BigInt(long.toString());
2115
+ }
2116
+
2117
+ if (_m0.util.Long !== Long) {
2118
+ _m0.util.Long = Long as any;
2119
+ _m0.configure();
2120
+ }
2121
+
2122
+ function isSet(value: any): boolean {
2123
+ return value !== null && value !== undefined;
2124
+ }
2125
+
2126
+ export type ServerStreamingMethodResult<Response> = { [Symbol.asyncIterator](): AsyncIterator<Response, void> };