@sentio/sdk 1.31.6 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/aptos/aptos-processor.d.ts +5 -5
- package/lib/aptos/aptos-processor.js +7 -4
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/cli/commands/login-server.js +4 -5
- package/lib/cli/commands/login-server.js.map +1 -1
- package/lib/cli/commands/run-login.js +6 -2
- package/lib/cli/commands/run-login.js.map +1 -1
- package/lib/cli/config.js +13 -18
- package/lib/cli/config.js.map +1 -1
- package/lib/core/base-processor-template.d.ts +6 -5
- package/lib/core/base-processor-template.js +7 -4
- package/lib/core/base-processor-template.js.map +1 -1
- package/lib/core/base-processor.d.ts +6 -6
- package/lib/core/base-processor.js +7 -4
- package/lib/core/base-processor.js.map +1 -1
- package/lib/core/logger.js +1 -1
- package/lib/core/logger.js.map +1 -1
- package/lib/gen/chainquery/protos/chainquery.d.ts +106 -0
- package/lib/gen/chainquery/protos/chainquery.js +377 -2
- package/lib/gen/chainquery/protos/chainquery.js.map +1 -1
- package/lib/gen/processor/protos/processor.d.ts +13 -0
- package/lib/gen/processor/protos/processor.js +101 -3
- package/lib/gen/processor/protos/processor.js.map +1 -1
- package/lib/service.js +8 -4
- package/lib/service.js.map +1 -1
- package/lib/utils/chain.d.ts +2 -2
- package/lib/utils/chain.js +6 -4
- package/lib/utils/chain.js.map +1 -1
- package/package.json +1 -1
- package/src/aptos/aptos-processor.ts +22 -7
- package/src/cli/commands/login-server.ts +4 -5
- package/src/cli/commands/run-login.ts +6 -2
- package/src/cli/config.ts +14 -18
- package/src/core/base-processor-template.ts +18 -9
- package/src/core/base-processor.ts +18 -9
- package/src/core/logger.ts +1 -1
- package/src/gen/chainquery/protos/chainquery.ts +479 -1
- package/src/gen/processor/protos/processor.ts +124 -1
- package/src/service.ts +8 -5
- package/src/utils/chain.ts +8 -6
|
@@ -4,7 +4,7 @@ import { BaseContract, Event, EventFilter } from '@ethersproject/contracts'
|
|
|
4
4
|
import Long from 'long'
|
|
5
5
|
|
|
6
6
|
import { BoundContractView, ContractContext, ContractView } from './context'
|
|
7
|
-
import { AddressType, ProcessResult } from '../gen'
|
|
7
|
+
import { AddressType, HandleInterval, ProcessResult } from '../gen'
|
|
8
8
|
import { BindInternalOptions, BindOptions } from './bind-options'
|
|
9
9
|
import { PromiseOrVoid } from '../promise-or-void'
|
|
10
10
|
import { Trace } from './trace'
|
|
@@ -24,8 +24,8 @@ export class TraceHandler {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export class BlockHandlder {
|
|
27
|
-
blockInterval?:
|
|
28
|
-
timeIntervalInMinutes?:
|
|
27
|
+
blockInterval?: HandleInterval
|
|
28
|
+
timeIntervalInMinutes?: HandleInterval
|
|
29
29
|
handler: (block: Block) => Promise<ProcessResult>
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -121,22 +121,31 @@ export abstract class BaseProcessor<
|
|
|
121
121
|
|
|
122
122
|
public onBlockInterval(
|
|
123
123
|
handler: (block: Block, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
|
|
124
|
-
blockInterval = 1000
|
|
124
|
+
blockInterval = 1000,
|
|
125
|
+
backfillBlockInterval = 4000
|
|
125
126
|
) {
|
|
126
|
-
return this.onInterval(handler, undefined,
|
|
127
|
+
return this.onInterval(handler, undefined, {
|
|
128
|
+
recentInterval: blockInterval,
|
|
129
|
+
backfillInterval: backfillBlockInterval,
|
|
130
|
+
})
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
public onTimeInterval(
|
|
130
134
|
handler: (block: Block, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
|
|
131
|
-
timeIntervalInMinutes = 60
|
|
135
|
+
timeIntervalInMinutes = 60,
|
|
136
|
+
backfillTimeIntervalInMinutes = 240
|
|
132
137
|
) {
|
|
133
|
-
return this.onInterval(
|
|
138
|
+
return this.onInterval(
|
|
139
|
+
handler,
|
|
140
|
+
{ recentInterval: timeIntervalInMinutes, backfillInterval: backfillTimeIntervalInMinutes },
|
|
141
|
+
undefined
|
|
142
|
+
)
|
|
134
143
|
}
|
|
135
144
|
|
|
136
145
|
public onInterval(
|
|
137
146
|
handler: (block: Block, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,
|
|
138
|
-
timeInterval:
|
|
139
|
-
blockInterval:
|
|
147
|
+
timeInterval: HandleInterval | undefined,
|
|
148
|
+
blockInterval: HandleInterval | undefined
|
|
140
149
|
) {
|
|
141
150
|
const chainId = this.getChainId()
|
|
142
151
|
const contractView = this.CreateBoundContractView()
|
package/src/core/logger.ts
CHANGED
|
@@ -18,7 +18,7 @@ export class Logger extends NamedResultDescriptor {
|
|
|
18
18
|
|
|
19
19
|
log(level: LogLevel, message: any, attributes: Attributes = {}) {
|
|
20
20
|
if (typeof message !== 'string' && !(message instanceof String)) {
|
|
21
|
-
message =
|
|
21
|
+
message = JSON.stringify(message)
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
this.ctx.res.logs.push({
|
|
@@ -35,8 +35,19 @@ export interface AptosSQLQueryRequest {
|
|
|
35
35
|
arbitraryRange: boolean;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
export interface QueryPhaseSummary {
|
|
39
|
+
name: string;
|
|
40
|
+
timeTookMs: Long;
|
|
41
|
+
}
|
|
42
|
+
|
|
38
43
|
export interface QueryExecutionSummary {
|
|
39
44
|
timeTookMs: Long;
|
|
45
|
+
resultNumRows?: Long | undefined;
|
|
46
|
+
resultNumBytes?: Long | undefined;
|
|
47
|
+
numPartitionsWithMaterializedView?: Long | undefined;
|
|
48
|
+
numPartitionsWithoutMaterializedView?: Long | undefined;
|
|
49
|
+
numPartitions?: Long | undefined;
|
|
50
|
+
phases: QueryPhaseSummary[];
|
|
40
51
|
}
|
|
41
52
|
|
|
42
53
|
export interface AptosGetTxnsResponse {
|
|
@@ -48,6 +59,22 @@ export interface AptosRefreshRequest {}
|
|
|
48
59
|
|
|
49
60
|
export interface VoidResponse {}
|
|
50
61
|
|
|
62
|
+
export interface EvmSQLQueryRequest {
|
|
63
|
+
network: string;
|
|
64
|
+
sql: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface EvmGetHeaderRequest {
|
|
68
|
+
network: string;
|
|
69
|
+
fromBlock: Long;
|
|
70
|
+
toBlock: Long;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface EvmQueryResponse {
|
|
74
|
+
rows: string[];
|
|
75
|
+
executionSummary?: QueryExecutionSummary | undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
51
78
|
function createBaseAptosGetTxnsByFunctionRequest(): AptosGetTxnsByFunctionRequest {
|
|
52
79
|
return {
|
|
53
80
|
network: "",
|
|
@@ -501,8 +528,83 @@ export const AptosSQLQueryRequest = {
|
|
|
501
528
|
},
|
|
502
529
|
};
|
|
503
530
|
|
|
531
|
+
function createBaseQueryPhaseSummary(): QueryPhaseSummary {
|
|
532
|
+
return { name: "", timeTookMs: Long.UZERO };
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export const QueryPhaseSummary = {
|
|
536
|
+
encode(
|
|
537
|
+
message: QueryPhaseSummary,
|
|
538
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
539
|
+
): _m0.Writer {
|
|
540
|
+
if (message.name !== "") {
|
|
541
|
+
writer.uint32(10).string(message.name);
|
|
542
|
+
}
|
|
543
|
+
if (!message.timeTookMs.isZero()) {
|
|
544
|
+
writer.uint32(16).uint64(message.timeTookMs);
|
|
545
|
+
}
|
|
546
|
+
return writer;
|
|
547
|
+
},
|
|
548
|
+
|
|
549
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): QueryPhaseSummary {
|
|
550
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
551
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
552
|
+
const message = createBaseQueryPhaseSummary();
|
|
553
|
+
while (reader.pos < end) {
|
|
554
|
+
const tag = reader.uint32();
|
|
555
|
+
switch (tag >>> 3) {
|
|
556
|
+
case 1:
|
|
557
|
+
message.name = reader.string();
|
|
558
|
+
break;
|
|
559
|
+
case 2:
|
|
560
|
+
message.timeTookMs = reader.uint64() as Long;
|
|
561
|
+
break;
|
|
562
|
+
default:
|
|
563
|
+
reader.skipType(tag & 7);
|
|
564
|
+
break;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return message;
|
|
568
|
+
},
|
|
569
|
+
|
|
570
|
+
fromJSON(object: any): QueryPhaseSummary {
|
|
571
|
+
return {
|
|
572
|
+
name: isSet(object.name) ? String(object.name) : "",
|
|
573
|
+
timeTookMs: isSet(object.timeTookMs)
|
|
574
|
+
? Long.fromValue(object.timeTookMs)
|
|
575
|
+
: Long.UZERO,
|
|
576
|
+
};
|
|
577
|
+
},
|
|
578
|
+
|
|
579
|
+
toJSON(message: QueryPhaseSummary): unknown {
|
|
580
|
+
const obj: any = {};
|
|
581
|
+
message.name !== undefined && (obj.name = message.name);
|
|
582
|
+
message.timeTookMs !== undefined &&
|
|
583
|
+
(obj.timeTookMs = (message.timeTookMs || Long.UZERO).toString());
|
|
584
|
+
return obj;
|
|
585
|
+
},
|
|
586
|
+
|
|
587
|
+
fromPartial(object: DeepPartial<QueryPhaseSummary>): QueryPhaseSummary {
|
|
588
|
+
const message = createBaseQueryPhaseSummary();
|
|
589
|
+
message.name = object.name ?? "";
|
|
590
|
+
message.timeTookMs =
|
|
591
|
+
object.timeTookMs !== undefined && object.timeTookMs !== null
|
|
592
|
+
? Long.fromValue(object.timeTookMs)
|
|
593
|
+
: Long.UZERO;
|
|
594
|
+
return message;
|
|
595
|
+
},
|
|
596
|
+
};
|
|
597
|
+
|
|
504
598
|
function createBaseQueryExecutionSummary(): QueryExecutionSummary {
|
|
505
|
-
return {
|
|
599
|
+
return {
|
|
600
|
+
timeTookMs: Long.UZERO,
|
|
601
|
+
resultNumRows: undefined,
|
|
602
|
+
resultNumBytes: undefined,
|
|
603
|
+
numPartitionsWithMaterializedView: undefined,
|
|
604
|
+
numPartitionsWithoutMaterializedView: undefined,
|
|
605
|
+
numPartitions: undefined,
|
|
606
|
+
phases: [],
|
|
607
|
+
};
|
|
506
608
|
}
|
|
507
609
|
|
|
508
610
|
export const QueryExecutionSummary = {
|
|
@@ -513,6 +615,24 @@ export const QueryExecutionSummary = {
|
|
|
513
615
|
if (!message.timeTookMs.isZero()) {
|
|
514
616
|
writer.uint32(8).uint64(message.timeTookMs);
|
|
515
617
|
}
|
|
618
|
+
if (message.resultNumRows !== undefined) {
|
|
619
|
+
writer.uint32(16).uint64(message.resultNumRows);
|
|
620
|
+
}
|
|
621
|
+
if (message.resultNumBytes !== undefined) {
|
|
622
|
+
writer.uint32(24).uint64(message.resultNumBytes);
|
|
623
|
+
}
|
|
624
|
+
if (message.numPartitionsWithMaterializedView !== undefined) {
|
|
625
|
+
writer.uint32(32).uint64(message.numPartitionsWithMaterializedView);
|
|
626
|
+
}
|
|
627
|
+
if (message.numPartitionsWithoutMaterializedView !== undefined) {
|
|
628
|
+
writer.uint32(40).uint64(message.numPartitionsWithoutMaterializedView);
|
|
629
|
+
}
|
|
630
|
+
if (message.numPartitions !== undefined) {
|
|
631
|
+
writer.uint32(48).uint64(message.numPartitions);
|
|
632
|
+
}
|
|
633
|
+
for (const v of message.phases) {
|
|
634
|
+
QueryPhaseSummary.encode(v!, writer.uint32(58).fork()).ldelim();
|
|
635
|
+
}
|
|
516
636
|
return writer;
|
|
517
637
|
},
|
|
518
638
|
|
|
@@ -529,6 +649,27 @@ export const QueryExecutionSummary = {
|
|
|
529
649
|
case 1:
|
|
530
650
|
message.timeTookMs = reader.uint64() as Long;
|
|
531
651
|
break;
|
|
652
|
+
case 2:
|
|
653
|
+
message.resultNumRows = reader.uint64() as Long;
|
|
654
|
+
break;
|
|
655
|
+
case 3:
|
|
656
|
+
message.resultNumBytes = reader.uint64() as Long;
|
|
657
|
+
break;
|
|
658
|
+
case 4:
|
|
659
|
+
message.numPartitionsWithMaterializedView = reader.uint64() as Long;
|
|
660
|
+
break;
|
|
661
|
+
case 5:
|
|
662
|
+
message.numPartitionsWithoutMaterializedView =
|
|
663
|
+
reader.uint64() as Long;
|
|
664
|
+
break;
|
|
665
|
+
case 6:
|
|
666
|
+
message.numPartitions = reader.uint64() as Long;
|
|
667
|
+
break;
|
|
668
|
+
case 7:
|
|
669
|
+
message.phases.push(
|
|
670
|
+
QueryPhaseSummary.decode(reader, reader.uint32())
|
|
671
|
+
);
|
|
672
|
+
break;
|
|
532
673
|
default:
|
|
533
674
|
reader.skipType(tag & 7);
|
|
534
675
|
break;
|
|
@@ -542,6 +683,28 @@ export const QueryExecutionSummary = {
|
|
|
542
683
|
timeTookMs: isSet(object.timeTookMs)
|
|
543
684
|
? Long.fromValue(object.timeTookMs)
|
|
544
685
|
: Long.UZERO,
|
|
686
|
+
resultNumRows: isSet(object.resultNumRows)
|
|
687
|
+
? Long.fromValue(object.resultNumRows)
|
|
688
|
+
: undefined,
|
|
689
|
+
resultNumBytes: isSet(object.resultNumBytes)
|
|
690
|
+
? Long.fromValue(object.resultNumBytes)
|
|
691
|
+
: undefined,
|
|
692
|
+
numPartitionsWithMaterializedView: isSet(
|
|
693
|
+
object.numPartitionsWithMaterializedView
|
|
694
|
+
)
|
|
695
|
+
? Long.fromValue(object.numPartitionsWithMaterializedView)
|
|
696
|
+
: undefined,
|
|
697
|
+
numPartitionsWithoutMaterializedView: isSet(
|
|
698
|
+
object.numPartitionsWithoutMaterializedView
|
|
699
|
+
)
|
|
700
|
+
? Long.fromValue(object.numPartitionsWithoutMaterializedView)
|
|
701
|
+
: undefined,
|
|
702
|
+
numPartitions: isSet(object.numPartitions)
|
|
703
|
+
? Long.fromValue(object.numPartitions)
|
|
704
|
+
: undefined,
|
|
705
|
+
phases: Array.isArray(object?.phases)
|
|
706
|
+
? object.phases.map((e: any) => QueryPhaseSummary.fromJSON(e))
|
|
707
|
+
: [],
|
|
545
708
|
};
|
|
546
709
|
},
|
|
547
710
|
|
|
@@ -549,6 +712,27 @@ export const QueryExecutionSummary = {
|
|
|
549
712
|
const obj: any = {};
|
|
550
713
|
message.timeTookMs !== undefined &&
|
|
551
714
|
(obj.timeTookMs = (message.timeTookMs || Long.UZERO).toString());
|
|
715
|
+
message.resultNumRows !== undefined &&
|
|
716
|
+
(obj.resultNumRows = (message.resultNumRows || undefined).toString());
|
|
717
|
+
message.resultNumBytes !== undefined &&
|
|
718
|
+
(obj.resultNumBytes = (message.resultNumBytes || undefined).toString());
|
|
719
|
+
message.numPartitionsWithMaterializedView !== undefined &&
|
|
720
|
+
(obj.numPartitionsWithMaterializedView = (
|
|
721
|
+
message.numPartitionsWithMaterializedView || undefined
|
|
722
|
+
).toString());
|
|
723
|
+
message.numPartitionsWithoutMaterializedView !== undefined &&
|
|
724
|
+
(obj.numPartitionsWithoutMaterializedView = (
|
|
725
|
+
message.numPartitionsWithoutMaterializedView || undefined
|
|
726
|
+
).toString());
|
|
727
|
+
message.numPartitions !== undefined &&
|
|
728
|
+
(obj.numPartitions = (message.numPartitions || undefined).toString());
|
|
729
|
+
if (message.phases) {
|
|
730
|
+
obj.phases = message.phases.map((e) =>
|
|
731
|
+
e ? QueryPhaseSummary.toJSON(e) : undefined
|
|
732
|
+
);
|
|
733
|
+
} else {
|
|
734
|
+
obj.phases = [];
|
|
735
|
+
}
|
|
552
736
|
return obj;
|
|
553
737
|
},
|
|
554
738
|
|
|
@@ -560,6 +744,30 @@ export const QueryExecutionSummary = {
|
|
|
560
744
|
object.timeTookMs !== undefined && object.timeTookMs !== null
|
|
561
745
|
? Long.fromValue(object.timeTookMs)
|
|
562
746
|
: Long.UZERO;
|
|
747
|
+
message.resultNumRows =
|
|
748
|
+
object.resultNumRows !== undefined && object.resultNumRows !== null
|
|
749
|
+
? Long.fromValue(object.resultNumRows)
|
|
750
|
+
: undefined;
|
|
751
|
+
message.resultNumBytes =
|
|
752
|
+
object.resultNumBytes !== undefined && object.resultNumBytes !== null
|
|
753
|
+
? Long.fromValue(object.resultNumBytes)
|
|
754
|
+
: undefined;
|
|
755
|
+
message.numPartitionsWithMaterializedView =
|
|
756
|
+
object.numPartitionsWithMaterializedView !== undefined &&
|
|
757
|
+
object.numPartitionsWithMaterializedView !== null
|
|
758
|
+
? Long.fromValue(object.numPartitionsWithMaterializedView)
|
|
759
|
+
: undefined;
|
|
760
|
+
message.numPartitionsWithoutMaterializedView =
|
|
761
|
+
object.numPartitionsWithoutMaterializedView !== undefined &&
|
|
762
|
+
object.numPartitionsWithoutMaterializedView !== null
|
|
763
|
+
? Long.fromValue(object.numPartitionsWithoutMaterializedView)
|
|
764
|
+
: undefined;
|
|
765
|
+
message.numPartitions =
|
|
766
|
+
object.numPartitions !== undefined && object.numPartitions !== null
|
|
767
|
+
? Long.fromValue(object.numPartitions)
|
|
768
|
+
: undefined;
|
|
769
|
+
message.phases =
|
|
770
|
+
object.phases?.map((e) => QueryPhaseSummary.fromPartial(e)) || [];
|
|
563
771
|
return message;
|
|
564
772
|
},
|
|
565
773
|
};
|
|
@@ -732,6 +940,230 @@ export const VoidResponse = {
|
|
|
732
940
|
},
|
|
733
941
|
};
|
|
734
942
|
|
|
943
|
+
function createBaseEvmSQLQueryRequest(): EvmSQLQueryRequest {
|
|
944
|
+
return { network: "", sql: "" };
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
export const EvmSQLQueryRequest = {
|
|
948
|
+
encode(
|
|
949
|
+
message: EvmSQLQueryRequest,
|
|
950
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
951
|
+
): _m0.Writer {
|
|
952
|
+
if (message.network !== "") {
|
|
953
|
+
writer.uint32(10).string(message.network);
|
|
954
|
+
}
|
|
955
|
+
if (message.sql !== "") {
|
|
956
|
+
writer.uint32(18).string(message.sql);
|
|
957
|
+
}
|
|
958
|
+
return writer;
|
|
959
|
+
},
|
|
960
|
+
|
|
961
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): EvmSQLQueryRequest {
|
|
962
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
963
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
964
|
+
const message = createBaseEvmSQLQueryRequest();
|
|
965
|
+
while (reader.pos < end) {
|
|
966
|
+
const tag = reader.uint32();
|
|
967
|
+
switch (tag >>> 3) {
|
|
968
|
+
case 1:
|
|
969
|
+
message.network = reader.string();
|
|
970
|
+
break;
|
|
971
|
+
case 2:
|
|
972
|
+
message.sql = reader.string();
|
|
973
|
+
break;
|
|
974
|
+
default:
|
|
975
|
+
reader.skipType(tag & 7);
|
|
976
|
+
break;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
return message;
|
|
980
|
+
},
|
|
981
|
+
|
|
982
|
+
fromJSON(object: any): EvmSQLQueryRequest {
|
|
983
|
+
return {
|
|
984
|
+
network: isSet(object.network) ? String(object.network) : "",
|
|
985
|
+
sql: isSet(object.sql) ? String(object.sql) : "",
|
|
986
|
+
};
|
|
987
|
+
},
|
|
988
|
+
|
|
989
|
+
toJSON(message: EvmSQLQueryRequest): unknown {
|
|
990
|
+
const obj: any = {};
|
|
991
|
+
message.network !== undefined && (obj.network = message.network);
|
|
992
|
+
message.sql !== undefined && (obj.sql = message.sql);
|
|
993
|
+
return obj;
|
|
994
|
+
},
|
|
995
|
+
|
|
996
|
+
fromPartial(object: DeepPartial<EvmSQLQueryRequest>): EvmSQLQueryRequest {
|
|
997
|
+
const message = createBaseEvmSQLQueryRequest();
|
|
998
|
+
message.network = object.network ?? "";
|
|
999
|
+
message.sql = object.sql ?? "";
|
|
1000
|
+
return message;
|
|
1001
|
+
},
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
function createBaseEvmGetHeaderRequest(): EvmGetHeaderRequest {
|
|
1005
|
+
return { network: "", fromBlock: Long.UZERO, toBlock: Long.UZERO };
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
export const EvmGetHeaderRequest = {
|
|
1009
|
+
encode(
|
|
1010
|
+
message: EvmGetHeaderRequest,
|
|
1011
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1012
|
+
): _m0.Writer {
|
|
1013
|
+
if (message.network !== "") {
|
|
1014
|
+
writer.uint32(10).string(message.network);
|
|
1015
|
+
}
|
|
1016
|
+
if (!message.fromBlock.isZero()) {
|
|
1017
|
+
writer.uint32(16).uint64(message.fromBlock);
|
|
1018
|
+
}
|
|
1019
|
+
if (!message.toBlock.isZero()) {
|
|
1020
|
+
writer.uint32(24).uint64(message.toBlock);
|
|
1021
|
+
}
|
|
1022
|
+
return writer;
|
|
1023
|
+
},
|
|
1024
|
+
|
|
1025
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): EvmGetHeaderRequest {
|
|
1026
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1027
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1028
|
+
const message = createBaseEvmGetHeaderRequest();
|
|
1029
|
+
while (reader.pos < end) {
|
|
1030
|
+
const tag = reader.uint32();
|
|
1031
|
+
switch (tag >>> 3) {
|
|
1032
|
+
case 1:
|
|
1033
|
+
message.network = reader.string();
|
|
1034
|
+
break;
|
|
1035
|
+
case 2:
|
|
1036
|
+
message.fromBlock = reader.uint64() as Long;
|
|
1037
|
+
break;
|
|
1038
|
+
case 3:
|
|
1039
|
+
message.toBlock = reader.uint64() as Long;
|
|
1040
|
+
break;
|
|
1041
|
+
default:
|
|
1042
|
+
reader.skipType(tag & 7);
|
|
1043
|
+
break;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
return message;
|
|
1047
|
+
},
|
|
1048
|
+
|
|
1049
|
+
fromJSON(object: any): EvmGetHeaderRequest {
|
|
1050
|
+
return {
|
|
1051
|
+
network: isSet(object.network) ? String(object.network) : "",
|
|
1052
|
+
fromBlock: isSet(object.fromBlock)
|
|
1053
|
+
? Long.fromValue(object.fromBlock)
|
|
1054
|
+
: Long.UZERO,
|
|
1055
|
+
toBlock: isSet(object.toBlock)
|
|
1056
|
+
? Long.fromValue(object.toBlock)
|
|
1057
|
+
: Long.UZERO,
|
|
1058
|
+
};
|
|
1059
|
+
},
|
|
1060
|
+
|
|
1061
|
+
toJSON(message: EvmGetHeaderRequest): unknown {
|
|
1062
|
+
const obj: any = {};
|
|
1063
|
+
message.network !== undefined && (obj.network = message.network);
|
|
1064
|
+
message.fromBlock !== undefined &&
|
|
1065
|
+
(obj.fromBlock = (message.fromBlock || Long.UZERO).toString());
|
|
1066
|
+
message.toBlock !== undefined &&
|
|
1067
|
+
(obj.toBlock = (message.toBlock || Long.UZERO).toString());
|
|
1068
|
+
return obj;
|
|
1069
|
+
},
|
|
1070
|
+
|
|
1071
|
+
fromPartial(object: DeepPartial<EvmGetHeaderRequest>): EvmGetHeaderRequest {
|
|
1072
|
+
const message = createBaseEvmGetHeaderRequest();
|
|
1073
|
+
message.network = object.network ?? "";
|
|
1074
|
+
message.fromBlock =
|
|
1075
|
+
object.fromBlock !== undefined && object.fromBlock !== null
|
|
1076
|
+
? Long.fromValue(object.fromBlock)
|
|
1077
|
+
: Long.UZERO;
|
|
1078
|
+
message.toBlock =
|
|
1079
|
+
object.toBlock !== undefined && object.toBlock !== null
|
|
1080
|
+
? Long.fromValue(object.toBlock)
|
|
1081
|
+
: Long.UZERO;
|
|
1082
|
+
return message;
|
|
1083
|
+
},
|
|
1084
|
+
};
|
|
1085
|
+
|
|
1086
|
+
function createBaseEvmQueryResponse(): EvmQueryResponse {
|
|
1087
|
+
return { rows: [], executionSummary: undefined };
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
export const EvmQueryResponse = {
|
|
1091
|
+
encode(
|
|
1092
|
+
message: EvmQueryResponse,
|
|
1093
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1094
|
+
): _m0.Writer {
|
|
1095
|
+
for (const v of message.rows) {
|
|
1096
|
+
writer.uint32(10).string(v!);
|
|
1097
|
+
}
|
|
1098
|
+
if (message.executionSummary !== undefined) {
|
|
1099
|
+
QueryExecutionSummary.encode(
|
|
1100
|
+
message.executionSummary,
|
|
1101
|
+
writer.uint32(18).fork()
|
|
1102
|
+
).ldelim();
|
|
1103
|
+
}
|
|
1104
|
+
return writer;
|
|
1105
|
+
},
|
|
1106
|
+
|
|
1107
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): EvmQueryResponse {
|
|
1108
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1109
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1110
|
+
const message = createBaseEvmQueryResponse();
|
|
1111
|
+
while (reader.pos < end) {
|
|
1112
|
+
const tag = reader.uint32();
|
|
1113
|
+
switch (tag >>> 3) {
|
|
1114
|
+
case 1:
|
|
1115
|
+
message.rows.push(reader.string());
|
|
1116
|
+
break;
|
|
1117
|
+
case 2:
|
|
1118
|
+
message.executionSummary = QueryExecutionSummary.decode(
|
|
1119
|
+
reader,
|
|
1120
|
+
reader.uint32()
|
|
1121
|
+
);
|
|
1122
|
+
break;
|
|
1123
|
+
default:
|
|
1124
|
+
reader.skipType(tag & 7);
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
return message;
|
|
1129
|
+
},
|
|
1130
|
+
|
|
1131
|
+
fromJSON(object: any): EvmQueryResponse {
|
|
1132
|
+
return {
|
|
1133
|
+
rows: Array.isArray(object?.rows)
|
|
1134
|
+
? object.rows.map((e: any) => String(e))
|
|
1135
|
+
: [],
|
|
1136
|
+
executionSummary: isSet(object.executionSummary)
|
|
1137
|
+
? QueryExecutionSummary.fromJSON(object.executionSummary)
|
|
1138
|
+
: undefined,
|
|
1139
|
+
};
|
|
1140
|
+
},
|
|
1141
|
+
|
|
1142
|
+
toJSON(message: EvmQueryResponse): unknown {
|
|
1143
|
+
const obj: any = {};
|
|
1144
|
+
if (message.rows) {
|
|
1145
|
+
obj.rows = message.rows.map((e) => e);
|
|
1146
|
+
} else {
|
|
1147
|
+
obj.rows = [];
|
|
1148
|
+
}
|
|
1149
|
+
message.executionSummary !== undefined &&
|
|
1150
|
+
(obj.executionSummary = message.executionSummary
|
|
1151
|
+
? QueryExecutionSummary.toJSON(message.executionSummary)
|
|
1152
|
+
: undefined);
|
|
1153
|
+
return obj;
|
|
1154
|
+
},
|
|
1155
|
+
|
|
1156
|
+
fromPartial(object: DeepPartial<EvmQueryResponse>): EvmQueryResponse {
|
|
1157
|
+
const message = createBaseEvmQueryResponse();
|
|
1158
|
+
message.rows = object.rows?.map((e) => e) || [];
|
|
1159
|
+
message.executionSummary =
|
|
1160
|
+
object.executionSummary !== undefined && object.executionSummary !== null
|
|
1161
|
+
? QueryExecutionSummary.fromPartial(object.executionSummary)
|
|
1162
|
+
: undefined;
|
|
1163
|
+
return message;
|
|
1164
|
+
},
|
|
1165
|
+
};
|
|
1166
|
+
|
|
735
1167
|
export type AptosQueryDefinition = typeof AptosQueryDefinition;
|
|
736
1168
|
export const AptosQueryDefinition = {
|
|
737
1169
|
name: "AptosQuery",
|
|
@@ -858,6 +1290,52 @@ export interface AptosQueryClient<CallOptionsExt = {}> {
|
|
|
858
1290
|
): Promise<AptosGetTxnsResponse>;
|
|
859
1291
|
}
|
|
860
1292
|
|
|
1293
|
+
export type EvmQueryDefinition = typeof EvmQueryDefinition;
|
|
1294
|
+
export const EvmQueryDefinition = {
|
|
1295
|
+
name: "EvmQuery",
|
|
1296
|
+
fullName: "chainquery.EvmQuery",
|
|
1297
|
+
methods: {
|
|
1298
|
+
evmSQLQuery: {
|
|
1299
|
+
name: "EvmSQLQuery",
|
|
1300
|
+
requestType: EvmSQLQueryRequest,
|
|
1301
|
+
requestStream: false,
|
|
1302
|
+
responseType: EvmQueryResponse,
|
|
1303
|
+
responseStream: true,
|
|
1304
|
+
options: {},
|
|
1305
|
+
},
|
|
1306
|
+
evmGetHeader: {
|
|
1307
|
+
name: "EvmGetHeader",
|
|
1308
|
+
requestType: EvmGetHeaderRequest,
|
|
1309
|
+
requestStream: false,
|
|
1310
|
+
responseType: EvmQueryResponse,
|
|
1311
|
+
responseStream: false,
|
|
1312
|
+
options: {},
|
|
1313
|
+
},
|
|
1314
|
+
},
|
|
1315
|
+
} as const;
|
|
1316
|
+
|
|
1317
|
+
export interface EvmQueryServiceImplementation<CallContextExt = {}> {
|
|
1318
|
+
evmSQLQuery(
|
|
1319
|
+
request: EvmSQLQueryRequest,
|
|
1320
|
+
context: CallContext & CallContextExt
|
|
1321
|
+
): ServerStreamingMethodResult<DeepPartial<EvmQueryResponse>>;
|
|
1322
|
+
evmGetHeader(
|
|
1323
|
+
request: EvmGetHeaderRequest,
|
|
1324
|
+
context: CallContext & CallContextExt
|
|
1325
|
+
): Promise<DeepPartial<EvmQueryResponse>>;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
export interface EvmQueryClient<CallOptionsExt = {}> {
|
|
1329
|
+
evmSQLQuery(
|
|
1330
|
+
request: DeepPartial<EvmSQLQueryRequest>,
|
|
1331
|
+
options?: CallOptions & CallOptionsExt
|
|
1332
|
+
): AsyncIterable<EvmQueryResponse>;
|
|
1333
|
+
evmGetHeader(
|
|
1334
|
+
request: DeepPartial<EvmGetHeaderRequest>,
|
|
1335
|
+
options?: CallOptions & CallOptionsExt
|
|
1336
|
+
): Promise<EvmQueryResponse>;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
861
1339
|
type Builtin =
|
|
862
1340
|
| Date
|
|
863
1341
|
| Function
|