@sentio/sdk 1.27.1 → 1.27.3
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/aptos/types.js +4 -3
- package/lib/aptos/types.js.map +1 -1
- package/lib/aptos/types.test.d.ts +1 -0
- package/lib/aptos/types.test.js +19 -0
- package/lib/aptos/types.test.js.map +1 -0
- package/lib/aptos/utils.d.ts +4 -1
- package/lib/aptos/utils.js +16 -1
- package/lib/aptos/utils.js.map +1 -1
- package/lib/aptos-codegen/codegen.js +15 -21
- package/lib/aptos-codegen/codegen.js.map +1 -1
- package/lib/builtin/aptos/0x1.d.ts +8 -8
- package/lib/builtin/aptos/0x1.js.map +1 -1
- package/lib/builtin/aptos/0x3.d.ts +1 -1
- package/lib/builtin/aptos/0x3.js.map +1 -1
- package/lib/cli/upload.js +17 -2
- package/lib/cli/upload.js.map +1 -1
- package/lib/gen/chainquery/protos/chainquery.d.ts +223 -0
- package/lib/gen/chainquery/protos/chainquery.js +628 -0
- package/lib/gen/chainquery/protos/chainquery.js.map +1 -0
- package/lib/tests/aptos.test.js +76 -1
- package/lib/tests/aptos.test.js.map +1 -1
- package/lib/tests/souffl3.js +3 -0
- package/lib/tests/souffl3.js.map +1 -1
- package/lib/tests/types/aptos/soffl3.d.ts +786 -0
- package/lib/tests/types/aptos/soffl3.js +559 -0
- package/lib/tests/types/aptos/soffl3.js.map +1 -0
- package/lib/tests/types/aptos/souffle.d.ts +16 -16
- package/lib/tests/types/aptos/souffle.js.map +1 -1
- package/package.json +1 -1
- package/src/aptos/types.test.ts +18 -0
- package/src/aptos/types.ts +5 -4
- package/src/aptos/utils.ts +18 -1
- package/src/aptos-codegen/codegen.ts +16 -23
- package/src/builtin/aptos/0x1.ts +9 -8
- package/src/builtin/aptos/0x3.ts +1 -1
- package/src/cli/upload.ts +17 -2
- package/src/gen/chainquery/protos/chainquery.ts +840 -0
- package/src/tests/abis/aptos/soffl3.json +1411 -0
- package/src/tests/aptos.test.ts +79 -1
- package/src/tests/souffl3.ts +5 -1
- package/src/tests/types/aptos/soffl3.ts +1377 -0
- package/src/tests/types/aptos/souffle.ts +16 -16
@@ -0,0 +1,840 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
import { CallContext, CallOptions } from "nice-grpc-common";
|
3
|
+
import Long from "long";
|
4
|
+
import _m0 from "protobufjs/minimal";
|
5
|
+
|
6
|
+
export interface AptosGetTxnsByFunctionRequest {
|
7
|
+
network: string;
|
8
|
+
fromVersion: Long;
|
9
|
+
toVersion: Long;
|
10
|
+
function: string;
|
11
|
+
matchAll: boolean;
|
12
|
+
typedArguments: string[];
|
13
|
+
}
|
14
|
+
|
15
|
+
export interface AptosGetTxnsByVersionRequest {
|
16
|
+
network: string;
|
17
|
+
fromVersion: Long;
|
18
|
+
toVersion: Long;
|
19
|
+
}
|
20
|
+
|
21
|
+
export interface AptosGetTxnsByEventRequest {
|
22
|
+
network: string;
|
23
|
+
fromVersion: Long;
|
24
|
+
toVersion: Long;
|
25
|
+
address: string;
|
26
|
+
type: string;
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface AptosSQLQueryRequest {
|
30
|
+
network: string;
|
31
|
+
fromVersion: Long;
|
32
|
+
toVersion: Long;
|
33
|
+
sql: string;
|
34
|
+
arbitraryRange: boolean;
|
35
|
+
}
|
36
|
+
|
37
|
+
export interface QueryExecutionSummary {
|
38
|
+
timeTookMs: Long;
|
39
|
+
}
|
40
|
+
|
41
|
+
export interface AptosGetTxnsResponse {
|
42
|
+
documents: string[];
|
43
|
+
executionSummary: QueryExecutionSummary | undefined;
|
44
|
+
}
|
45
|
+
|
46
|
+
export interface AptosRefreshRequest {}
|
47
|
+
|
48
|
+
export interface VoidResponse {}
|
49
|
+
|
50
|
+
function createBaseAptosGetTxnsByFunctionRequest(): AptosGetTxnsByFunctionRequest {
|
51
|
+
return {
|
52
|
+
network: "",
|
53
|
+
fromVersion: Long.UZERO,
|
54
|
+
toVersion: Long.UZERO,
|
55
|
+
function: "",
|
56
|
+
matchAll: false,
|
57
|
+
typedArguments: [],
|
58
|
+
};
|
59
|
+
}
|
60
|
+
|
61
|
+
export const AptosGetTxnsByFunctionRequest = {
|
62
|
+
encode(
|
63
|
+
message: AptosGetTxnsByFunctionRequest,
|
64
|
+
writer: _m0.Writer = _m0.Writer.create()
|
65
|
+
): _m0.Writer {
|
66
|
+
if (message.network !== "") {
|
67
|
+
writer.uint32(10).string(message.network);
|
68
|
+
}
|
69
|
+
if (!message.fromVersion.isZero()) {
|
70
|
+
writer.uint32(16).uint64(message.fromVersion);
|
71
|
+
}
|
72
|
+
if (!message.toVersion.isZero()) {
|
73
|
+
writer.uint32(24).uint64(message.toVersion);
|
74
|
+
}
|
75
|
+
if (message.function !== "") {
|
76
|
+
writer.uint32(34).string(message.function);
|
77
|
+
}
|
78
|
+
if (message.matchAll === true) {
|
79
|
+
writer.uint32(40).bool(message.matchAll);
|
80
|
+
}
|
81
|
+
for (const v of message.typedArguments) {
|
82
|
+
writer.uint32(50).string(v!);
|
83
|
+
}
|
84
|
+
return writer;
|
85
|
+
},
|
86
|
+
|
87
|
+
decode(
|
88
|
+
input: _m0.Reader | Uint8Array,
|
89
|
+
length?: number
|
90
|
+
): AptosGetTxnsByFunctionRequest {
|
91
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
92
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
93
|
+
const message = createBaseAptosGetTxnsByFunctionRequest();
|
94
|
+
while (reader.pos < end) {
|
95
|
+
const tag = reader.uint32();
|
96
|
+
switch (tag >>> 3) {
|
97
|
+
case 1:
|
98
|
+
message.network = reader.string();
|
99
|
+
break;
|
100
|
+
case 2:
|
101
|
+
message.fromVersion = reader.uint64() as Long;
|
102
|
+
break;
|
103
|
+
case 3:
|
104
|
+
message.toVersion = reader.uint64() as Long;
|
105
|
+
break;
|
106
|
+
case 4:
|
107
|
+
message.function = reader.string();
|
108
|
+
break;
|
109
|
+
case 5:
|
110
|
+
message.matchAll = reader.bool();
|
111
|
+
break;
|
112
|
+
case 6:
|
113
|
+
message.typedArguments.push(reader.string());
|
114
|
+
break;
|
115
|
+
default:
|
116
|
+
reader.skipType(tag & 7);
|
117
|
+
break;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
return message;
|
121
|
+
},
|
122
|
+
|
123
|
+
fromJSON(object: any): AptosGetTxnsByFunctionRequest {
|
124
|
+
return {
|
125
|
+
network: isSet(object.network) ? String(object.network) : "",
|
126
|
+
fromVersion: isSet(object.fromVersion)
|
127
|
+
? Long.fromValue(object.fromVersion)
|
128
|
+
: Long.UZERO,
|
129
|
+
toVersion: isSet(object.toVersion)
|
130
|
+
? Long.fromValue(object.toVersion)
|
131
|
+
: Long.UZERO,
|
132
|
+
function: isSet(object.function) ? String(object.function) : "",
|
133
|
+
matchAll: isSet(object.matchAll) ? Boolean(object.matchAll) : false,
|
134
|
+
typedArguments: Array.isArray(object?.typedArguments)
|
135
|
+
? object.typedArguments.map((e: any) => String(e))
|
136
|
+
: [],
|
137
|
+
};
|
138
|
+
},
|
139
|
+
|
140
|
+
toJSON(message: AptosGetTxnsByFunctionRequest): unknown {
|
141
|
+
const obj: any = {};
|
142
|
+
message.network !== undefined && (obj.network = message.network);
|
143
|
+
message.fromVersion !== undefined &&
|
144
|
+
(obj.fromVersion = (message.fromVersion || Long.UZERO).toString());
|
145
|
+
message.toVersion !== undefined &&
|
146
|
+
(obj.toVersion = (message.toVersion || Long.UZERO).toString());
|
147
|
+
message.function !== undefined && (obj.function = message.function);
|
148
|
+
message.matchAll !== undefined && (obj.matchAll = message.matchAll);
|
149
|
+
if (message.typedArguments) {
|
150
|
+
obj.typedArguments = message.typedArguments.map((e) => e);
|
151
|
+
} else {
|
152
|
+
obj.typedArguments = [];
|
153
|
+
}
|
154
|
+
return obj;
|
155
|
+
},
|
156
|
+
|
157
|
+
fromPartial(
|
158
|
+
object: DeepPartial<AptosGetTxnsByFunctionRequest>
|
159
|
+
): AptosGetTxnsByFunctionRequest {
|
160
|
+
const message = createBaseAptosGetTxnsByFunctionRequest();
|
161
|
+
message.network = object.network ?? "";
|
162
|
+
message.fromVersion =
|
163
|
+
object.fromVersion !== undefined && object.fromVersion !== null
|
164
|
+
? Long.fromValue(object.fromVersion)
|
165
|
+
: Long.UZERO;
|
166
|
+
message.toVersion =
|
167
|
+
object.toVersion !== undefined && object.toVersion !== null
|
168
|
+
? Long.fromValue(object.toVersion)
|
169
|
+
: Long.UZERO;
|
170
|
+
message.function = object.function ?? "";
|
171
|
+
message.matchAll = object.matchAll ?? false;
|
172
|
+
message.typedArguments = object.typedArguments?.map((e) => e) || [];
|
173
|
+
return message;
|
174
|
+
},
|
175
|
+
};
|
176
|
+
|
177
|
+
function createBaseAptosGetTxnsByVersionRequest(): AptosGetTxnsByVersionRequest {
|
178
|
+
return { network: "", fromVersion: Long.UZERO, toVersion: Long.UZERO };
|
179
|
+
}
|
180
|
+
|
181
|
+
export const AptosGetTxnsByVersionRequest = {
|
182
|
+
encode(
|
183
|
+
message: AptosGetTxnsByVersionRequest,
|
184
|
+
writer: _m0.Writer = _m0.Writer.create()
|
185
|
+
): _m0.Writer {
|
186
|
+
if (message.network !== "") {
|
187
|
+
writer.uint32(10).string(message.network);
|
188
|
+
}
|
189
|
+
if (!message.fromVersion.isZero()) {
|
190
|
+
writer.uint32(16).uint64(message.fromVersion);
|
191
|
+
}
|
192
|
+
if (!message.toVersion.isZero()) {
|
193
|
+
writer.uint32(24).uint64(message.toVersion);
|
194
|
+
}
|
195
|
+
return writer;
|
196
|
+
},
|
197
|
+
|
198
|
+
decode(
|
199
|
+
input: _m0.Reader | Uint8Array,
|
200
|
+
length?: number
|
201
|
+
): AptosGetTxnsByVersionRequest {
|
202
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
203
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
204
|
+
const message = createBaseAptosGetTxnsByVersionRequest();
|
205
|
+
while (reader.pos < end) {
|
206
|
+
const tag = reader.uint32();
|
207
|
+
switch (tag >>> 3) {
|
208
|
+
case 1:
|
209
|
+
message.network = reader.string();
|
210
|
+
break;
|
211
|
+
case 2:
|
212
|
+
message.fromVersion = reader.uint64() as Long;
|
213
|
+
break;
|
214
|
+
case 3:
|
215
|
+
message.toVersion = reader.uint64() as Long;
|
216
|
+
break;
|
217
|
+
default:
|
218
|
+
reader.skipType(tag & 7);
|
219
|
+
break;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
return message;
|
223
|
+
},
|
224
|
+
|
225
|
+
fromJSON(object: any): AptosGetTxnsByVersionRequest {
|
226
|
+
return {
|
227
|
+
network: isSet(object.network) ? String(object.network) : "",
|
228
|
+
fromVersion: isSet(object.fromVersion)
|
229
|
+
? Long.fromValue(object.fromVersion)
|
230
|
+
: Long.UZERO,
|
231
|
+
toVersion: isSet(object.toVersion)
|
232
|
+
? Long.fromValue(object.toVersion)
|
233
|
+
: Long.UZERO,
|
234
|
+
};
|
235
|
+
},
|
236
|
+
|
237
|
+
toJSON(message: AptosGetTxnsByVersionRequest): unknown {
|
238
|
+
const obj: any = {};
|
239
|
+
message.network !== undefined && (obj.network = message.network);
|
240
|
+
message.fromVersion !== undefined &&
|
241
|
+
(obj.fromVersion = (message.fromVersion || Long.UZERO).toString());
|
242
|
+
message.toVersion !== undefined &&
|
243
|
+
(obj.toVersion = (message.toVersion || Long.UZERO).toString());
|
244
|
+
return obj;
|
245
|
+
},
|
246
|
+
|
247
|
+
fromPartial(
|
248
|
+
object: DeepPartial<AptosGetTxnsByVersionRequest>
|
249
|
+
): AptosGetTxnsByVersionRequest {
|
250
|
+
const message = createBaseAptosGetTxnsByVersionRequest();
|
251
|
+
message.network = object.network ?? "";
|
252
|
+
message.fromVersion =
|
253
|
+
object.fromVersion !== undefined && object.fromVersion !== null
|
254
|
+
? Long.fromValue(object.fromVersion)
|
255
|
+
: Long.UZERO;
|
256
|
+
message.toVersion =
|
257
|
+
object.toVersion !== undefined && object.toVersion !== null
|
258
|
+
? Long.fromValue(object.toVersion)
|
259
|
+
: Long.UZERO;
|
260
|
+
return message;
|
261
|
+
},
|
262
|
+
};
|
263
|
+
|
264
|
+
function createBaseAptosGetTxnsByEventRequest(): AptosGetTxnsByEventRequest {
|
265
|
+
return {
|
266
|
+
network: "",
|
267
|
+
fromVersion: Long.UZERO,
|
268
|
+
toVersion: Long.UZERO,
|
269
|
+
address: "",
|
270
|
+
type: "",
|
271
|
+
};
|
272
|
+
}
|
273
|
+
|
274
|
+
export const AptosGetTxnsByEventRequest = {
|
275
|
+
encode(
|
276
|
+
message: AptosGetTxnsByEventRequest,
|
277
|
+
writer: _m0.Writer = _m0.Writer.create()
|
278
|
+
): _m0.Writer {
|
279
|
+
if (message.network !== "") {
|
280
|
+
writer.uint32(10).string(message.network);
|
281
|
+
}
|
282
|
+
if (!message.fromVersion.isZero()) {
|
283
|
+
writer.uint32(16).uint64(message.fromVersion);
|
284
|
+
}
|
285
|
+
if (!message.toVersion.isZero()) {
|
286
|
+
writer.uint32(24).uint64(message.toVersion);
|
287
|
+
}
|
288
|
+
if (message.address !== "") {
|
289
|
+
writer.uint32(34).string(message.address);
|
290
|
+
}
|
291
|
+
if (message.type !== "") {
|
292
|
+
writer.uint32(42).string(message.type);
|
293
|
+
}
|
294
|
+
return writer;
|
295
|
+
},
|
296
|
+
|
297
|
+
decode(
|
298
|
+
input: _m0.Reader | Uint8Array,
|
299
|
+
length?: number
|
300
|
+
): AptosGetTxnsByEventRequest {
|
301
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
302
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
303
|
+
const message = createBaseAptosGetTxnsByEventRequest();
|
304
|
+
while (reader.pos < end) {
|
305
|
+
const tag = reader.uint32();
|
306
|
+
switch (tag >>> 3) {
|
307
|
+
case 1:
|
308
|
+
message.network = reader.string();
|
309
|
+
break;
|
310
|
+
case 2:
|
311
|
+
message.fromVersion = reader.uint64() as Long;
|
312
|
+
break;
|
313
|
+
case 3:
|
314
|
+
message.toVersion = reader.uint64() as Long;
|
315
|
+
break;
|
316
|
+
case 4:
|
317
|
+
message.address = reader.string();
|
318
|
+
break;
|
319
|
+
case 5:
|
320
|
+
message.type = reader.string();
|
321
|
+
break;
|
322
|
+
default:
|
323
|
+
reader.skipType(tag & 7);
|
324
|
+
break;
|
325
|
+
}
|
326
|
+
}
|
327
|
+
return message;
|
328
|
+
},
|
329
|
+
|
330
|
+
fromJSON(object: any): AptosGetTxnsByEventRequest {
|
331
|
+
return {
|
332
|
+
network: isSet(object.network) ? String(object.network) : "",
|
333
|
+
fromVersion: isSet(object.fromVersion)
|
334
|
+
? Long.fromValue(object.fromVersion)
|
335
|
+
: Long.UZERO,
|
336
|
+
toVersion: isSet(object.toVersion)
|
337
|
+
? Long.fromValue(object.toVersion)
|
338
|
+
: Long.UZERO,
|
339
|
+
address: isSet(object.address) ? String(object.address) : "",
|
340
|
+
type: isSet(object.type) ? String(object.type) : "",
|
341
|
+
};
|
342
|
+
},
|
343
|
+
|
344
|
+
toJSON(message: AptosGetTxnsByEventRequest): unknown {
|
345
|
+
const obj: any = {};
|
346
|
+
message.network !== undefined && (obj.network = message.network);
|
347
|
+
message.fromVersion !== undefined &&
|
348
|
+
(obj.fromVersion = (message.fromVersion || Long.UZERO).toString());
|
349
|
+
message.toVersion !== undefined &&
|
350
|
+
(obj.toVersion = (message.toVersion || Long.UZERO).toString());
|
351
|
+
message.address !== undefined && (obj.address = message.address);
|
352
|
+
message.type !== undefined && (obj.type = message.type);
|
353
|
+
return obj;
|
354
|
+
},
|
355
|
+
|
356
|
+
fromPartial(
|
357
|
+
object: DeepPartial<AptosGetTxnsByEventRequest>
|
358
|
+
): AptosGetTxnsByEventRequest {
|
359
|
+
const message = createBaseAptosGetTxnsByEventRequest();
|
360
|
+
message.network = object.network ?? "";
|
361
|
+
message.fromVersion =
|
362
|
+
object.fromVersion !== undefined && object.fromVersion !== null
|
363
|
+
? Long.fromValue(object.fromVersion)
|
364
|
+
: Long.UZERO;
|
365
|
+
message.toVersion =
|
366
|
+
object.toVersion !== undefined && object.toVersion !== null
|
367
|
+
? Long.fromValue(object.toVersion)
|
368
|
+
: Long.UZERO;
|
369
|
+
message.address = object.address ?? "";
|
370
|
+
message.type = object.type ?? "";
|
371
|
+
return message;
|
372
|
+
},
|
373
|
+
};
|
374
|
+
|
375
|
+
function createBaseAptosSQLQueryRequest(): AptosSQLQueryRequest {
|
376
|
+
return {
|
377
|
+
network: "",
|
378
|
+
fromVersion: Long.UZERO,
|
379
|
+
toVersion: Long.UZERO,
|
380
|
+
sql: "",
|
381
|
+
arbitraryRange: false,
|
382
|
+
};
|
383
|
+
}
|
384
|
+
|
385
|
+
export const AptosSQLQueryRequest = {
|
386
|
+
encode(
|
387
|
+
message: AptosSQLQueryRequest,
|
388
|
+
writer: _m0.Writer = _m0.Writer.create()
|
389
|
+
): _m0.Writer {
|
390
|
+
if (message.network !== "") {
|
391
|
+
writer.uint32(10).string(message.network);
|
392
|
+
}
|
393
|
+
if (!message.fromVersion.isZero()) {
|
394
|
+
writer.uint32(16).uint64(message.fromVersion);
|
395
|
+
}
|
396
|
+
if (!message.toVersion.isZero()) {
|
397
|
+
writer.uint32(24).uint64(message.toVersion);
|
398
|
+
}
|
399
|
+
if (message.sql !== "") {
|
400
|
+
writer.uint32(34).string(message.sql);
|
401
|
+
}
|
402
|
+
if (message.arbitraryRange === true) {
|
403
|
+
writer.uint32(40).bool(message.arbitraryRange);
|
404
|
+
}
|
405
|
+
return writer;
|
406
|
+
},
|
407
|
+
|
408
|
+
decode(
|
409
|
+
input: _m0.Reader | Uint8Array,
|
410
|
+
length?: number
|
411
|
+
): AptosSQLQueryRequest {
|
412
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
413
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
414
|
+
const message = createBaseAptosSQLQueryRequest();
|
415
|
+
while (reader.pos < end) {
|
416
|
+
const tag = reader.uint32();
|
417
|
+
switch (tag >>> 3) {
|
418
|
+
case 1:
|
419
|
+
message.network = reader.string();
|
420
|
+
break;
|
421
|
+
case 2:
|
422
|
+
message.fromVersion = reader.uint64() as Long;
|
423
|
+
break;
|
424
|
+
case 3:
|
425
|
+
message.toVersion = reader.uint64() as Long;
|
426
|
+
break;
|
427
|
+
case 4:
|
428
|
+
message.sql = reader.string();
|
429
|
+
break;
|
430
|
+
case 5:
|
431
|
+
message.arbitraryRange = reader.bool();
|
432
|
+
break;
|
433
|
+
default:
|
434
|
+
reader.skipType(tag & 7);
|
435
|
+
break;
|
436
|
+
}
|
437
|
+
}
|
438
|
+
return message;
|
439
|
+
},
|
440
|
+
|
441
|
+
fromJSON(object: any): AptosSQLQueryRequest {
|
442
|
+
return {
|
443
|
+
network: isSet(object.network) ? String(object.network) : "",
|
444
|
+
fromVersion: isSet(object.fromVersion)
|
445
|
+
? Long.fromValue(object.fromVersion)
|
446
|
+
: Long.UZERO,
|
447
|
+
toVersion: isSet(object.toVersion)
|
448
|
+
? Long.fromValue(object.toVersion)
|
449
|
+
: Long.UZERO,
|
450
|
+
sql: isSet(object.sql) ? String(object.sql) : "",
|
451
|
+
arbitraryRange: isSet(object.arbitraryRange)
|
452
|
+
? Boolean(object.arbitraryRange)
|
453
|
+
: false,
|
454
|
+
};
|
455
|
+
},
|
456
|
+
|
457
|
+
toJSON(message: AptosSQLQueryRequest): unknown {
|
458
|
+
const obj: any = {};
|
459
|
+
message.network !== undefined && (obj.network = message.network);
|
460
|
+
message.fromVersion !== undefined &&
|
461
|
+
(obj.fromVersion = (message.fromVersion || Long.UZERO).toString());
|
462
|
+
message.toVersion !== undefined &&
|
463
|
+
(obj.toVersion = (message.toVersion || Long.UZERO).toString());
|
464
|
+
message.sql !== undefined && (obj.sql = message.sql);
|
465
|
+
message.arbitraryRange !== undefined &&
|
466
|
+
(obj.arbitraryRange = message.arbitraryRange);
|
467
|
+
return obj;
|
468
|
+
},
|
469
|
+
|
470
|
+
fromPartial(object: DeepPartial<AptosSQLQueryRequest>): AptosSQLQueryRequest {
|
471
|
+
const message = createBaseAptosSQLQueryRequest();
|
472
|
+
message.network = object.network ?? "";
|
473
|
+
message.fromVersion =
|
474
|
+
object.fromVersion !== undefined && object.fromVersion !== null
|
475
|
+
? Long.fromValue(object.fromVersion)
|
476
|
+
: Long.UZERO;
|
477
|
+
message.toVersion =
|
478
|
+
object.toVersion !== undefined && object.toVersion !== null
|
479
|
+
? Long.fromValue(object.toVersion)
|
480
|
+
: Long.UZERO;
|
481
|
+
message.sql = object.sql ?? "";
|
482
|
+
message.arbitraryRange = object.arbitraryRange ?? false;
|
483
|
+
return message;
|
484
|
+
},
|
485
|
+
};
|
486
|
+
|
487
|
+
function createBaseQueryExecutionSummary(): QueryExecutionSummary {
|
488
|
+
return { timeTookMs: Long.UZERO };
|
489
|
+
}
|
490
|
+
|
491
|
+
export const QueryExecutionSummary = {
|
492
|
+
encode(
|
493
|
+
message: QueryExecutionSummary,
|
494
|
+
writer: _m0.Writer = _m0.Writer.create()
|
495
|
+
): _m0.Writer {
|
496
|
+
if (!message.timeTookMs.isZero()) {
|
497
|
+
writer.uint32(8).uint64(message.timeTookMs);
|
498
|
+
}
|
499
|
+
return writer;
|
500
|
+
},
|
501
|
+
|
502
|
+
decode(
|
503
|
+
input: _m0.Reader | Uint8Array,
|
504
|
+
length?: number
|
505
|
+
): QueryExecutionSummary {
|
506
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
507
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
508
|
+
const message = createBaseQueryExecutionSummary();
|
509
|
+
while (reader.pos < end) {
|
510
|
+
const tag = reader.uint32();
|
511
|
+
switch (tag >>> 3) {
|
512
|
+
case 1:
|
513
|
+
message.timeTookMs = reader.uint64() as Long;
|
514
|
+
break;
|
515
|
+
default:
|
516
|
+
reader.skipType(tag & 7);
|
517
|
+
break;
|
518
|
+
}
|
519
|
+
}
|
520
|
+
return message;
|
521
|
+
},
|
522
|
+
|
523
|
+
fromJSON(object: any): QueryExecutionSummary {
|
524
|
+
return {
|
525
|
+
timeTookMs: isSet(object.timeTookMs)
|
526
|
+
? Long.fromValue(object.timeTookMs)
|
527
|
+
: Long.UZERO,
|
528
|
+
};
|
529
|
+
},
|
530
|
+
|
531
|
+
toJSON(message: QueryExecutionSummary): unknown {
|
532
|
+
const obj: any = {};
|
533
|
+
message.timeTookMs !== undefined &&
|
534
|
+
(obj.timeTookMs = (message.timeTookMs || Long.UZERO).toString());
|
535
|
+
return obj;
|
536
|
+
},
|
537
|
+
|
538
|
+
fromPartial(
|
539
|
+
object: DeepPartial<QueryExecutionSummary>
|
540
|
+
): QueryExecutionSummary {
|
541
|
+
const message = createBaseQueryExecutionSummary();
|
542
|
+
message.timeTookMs =
|
543
|
+
object.timeTookMs !== undefined && object.timeTookMs !== null
|
544
|
+
? Long.fromValue(object.timeTookMs)
|
545
|
+
: Long.UZERO;
|
546
|
+
return message;
|
547
|
+
},
|
548
|
+
};
|
549
|
+
|
550
|
+
function createBaseAptosGetTxnsResponse(): AptosGetTxnsResponse {
|
551
|
+
return { documents: [], executionSummary: undefined };
|
552
|
+
}
|
553
|
+
|
554
|
+
export const AptosGetTxnsResponse = {
|
555
|
+
encode(
|
556
|
+
message: AptosGetTxnsResponse,
|
557
|
+
writer: _m0.Writer = _m0.Writer.create()
|
558
|
+
): _m0.Writer {
|
559
|
+
for (const v of message.documents) {
|
560
|
+
writer.uint32(10).string(v!);
|
561
|
+
}
|
562
|
+
if (message.executionSummary !== undefined) {
|
563
|
+
QueryExecutionSummary.encode(
|
564
|
+
message.executionSummary,
|
565
|
+
writer.uint32(18).fork()
|
566
|
+
).ldelim();
|
567
|
+
}
|
568
|
+
return writer;
|
569
|
+
},
|
570
|
+
|
571
|
+
decode(
|
572
|
+
input: _m0.Reader | Uint8Array,
|
573
|
+
length?: number
|
574
|
+
): AptosGetTxnsResponse {
|
575
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
576
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
577
|
+
const message = createBaseAptosGetTxnsResponse();
|
578
|
+
while (reader.pos < end) {
|
579
|
+
const tag = reader.uint32();
|
580
|
+
switch (tag >>> 3) {
|
581
|
+
case 1:
|
582
|
+
message.documents.push(reader.string());
|
583
|
+
break;
|
584
|
+
case 2:
|
585
|
+
message.executionSummary = QueryExecutionSummary.decode(
|
586
|
+
reader,
|
587
|
+
reader.uint32()
|
588
|
+
);
|
589
|
+
break;
|
590
|
+
default:
|
591
|
+
reader.skipType(tag & 7);
|
592
|
+
break;
|
593
|
+
}
|
594
|
+
}
|
595
|
+
return message;
|
596
|
+
},
|
597
|
+
|
598
|
+
fromJSON(object: any): AptosGetTxnsResponse {
|
599
|
+
return {
|
600
|
+
documents: Array.isArray(object?.documents)
|
601
|
+
? object.documents.map((e: any) => String(e))
|
602
|
+
: [],
|
603
|
+
executionSummary: isSet(object.executionSummary)
|
604
|
+
? QueryExecutionSummary.fromJSON(object.executionSummary)
|
605
|
+
: undefined,
|
606
|
+
};
|
607
|
+
},
|
608
|
+
|
609
|
+
toJSON(message: AptosGetTxnsResponse): unknown {
|
610
|
+
const obj: any = {};
|
611
|
+
if (message.documents) {
|
612
|
+
obj.documents = message.documents.map((e) => e);
|
613
|
+
} else {
|
614
|
+
obj.documents = [];
|
615
|
+
}
|
616
|
+
message.executionSummary !== undefined &&
|
617
|
+
(obj.executionSummary = message.executionSummary
|
618
|
+
? QueryExecutionSummary.toJSON(message.executionSummary)
|
619
|
+
: undefined);
|
620
|
+
return obj;
|
621
|
+
},
|
622
|
+
|
623
|
+
fromPartial(object: DeepPartial<AptosGetTxnsResponse>): AptosGetTxnsResponse {
|
624
|
+
const message = createBaseAptosGetTxnsResponse();
|
625
|
+
message.documents = object.documents?.map((e) => e) || [];
|
626
|
+
message.executionSummary =
|
627
|
+
object.executionSummary !== undefined && object.executionSummary !== null
|
628
|
+
? QueryExecutionSummary.fromPartial(object.executionSummary)
|
629
|
+
: undefined;
|
630
|
+
return message;
|
631
|
+
},
|
632
|
+
};
|
633
|
+
|
634
|
+
function createBaseAptosRefreshRequest(): AptosRefreshRequest {
|
635
|
+
return {};
|
636
|
+
}
|
637
|
+
|
638
|
+
export const AptosRefreshRequest = {
|
639
|
+
encode(
|
640
|
+
_: AptosRefreshRequest,
|
641
|
+
writer: _m0.Writer = _m0.Writer.create()
|
642
|
+
): _m0.Writer {
|
643
|
+
return writer;
|
644
|
+
},
|
645
|
+
|
646
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AptosRefreshRequest {
|
647
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
648
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
649
|
+
const message = createBaseAptosRefreshRequest();
|
650
|
+
while (reader.pos < end) {
|
651
|
+
const tag = reader.uint32();
|
652
|
+
switch (tag >>> 3) {
|
653
|
+
default:
|
654
|
+
reader.skipType(tag & 7);
|
655
|
+
break;
|
656
|
+
}
|
657
|
+
}
|
658
|
+
return message;
|
659
|
+
},
|
660
|
+
|
661
|
+
fromJSON(_: any): AptosRefreshRequest {
|
662
|
+
return {};
|
663
|
+
},
|
664
|
+
|
665
|
+
toJSON(_: AptosRefreshRequest): unknown {
|
666
|
+
const obj: any = {};
|
667
|
+
return obj;
|
668
|
+
},
|
669
|
+
|
670
|
+
fromPartial(_: DeepPartial<AptosRefreshRequest>): AptosRefreshRequest {
|
671
|
+
const message = createBaseAptosRefreshRequest();
|
672
|
+
return message;
|
673
|
+
},
|
674
|
+
};
|
675
|
+
|
676
|
+
function createBaseVoidResponse(): VoidResponse {
|
677
|
+
return {};
|
678
|
+
}
|
679
|
+
|
680
|
+
export const VoidResponse = {
|
681
|
+
encode(
|
682
|
+
_: VoidResponse,
|
683
|
+
writer: _m0.Writer = _m0.Writer.create()
|
684
|
+
): _m0.Writer {
|
685
|
+
return writer;
|
686
|
+
},
|
687
|
+
|
688
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): VoidResponse {
|
689
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
690
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
691
|
+
const message = createBaseVoidResponse();
|
692
|
+
while (reader.pos < end) {
|
693
|
+
const tag = reader.uint32();
|
694
|
+
switch (tag >>> 3) {
|
695
|
+
default:
|
696
|
+
reader.skipType(tag & 7);
|
697
|
+
break;
|
698
|
+
}
|
699
|
+
}
|
700
|
+
return message;
|
701
|
+
},
|
702
|
+
|
703
|
+
fromJSON(_: any): VoidResponse {
|
704
|
+
return {};
|
705
|
+
},
|
706
|
+
|
707
|
+
toJSON(_: VoidResponse): unknown {
|
708
|
+
const obj: any = {};
|
709
|
+
return obj;
|
710
|
+
},
|
711
|
+
|
712
|
+
fromPartial(_: DeepPartial<VoidResponse>): VoidResponse {
|
713
|
+
const message = createBaseVoidResponse();
|
714
|
+
return message;
|
715
|
+
},
|
716
|
+
};
|
717
|
+
|
718
|
+
export type AptosQueryDefinition = typeof AptosQueryDefinition;
|
719
|
+
export const AptosQueryDefinition = {
|
720
|
+
name: "AptosQuery",
|
721
|
+
fullName: "chainquery.AptosQuery",
|
722
|
+
methods: {
|
723
|
+
aptosGetTxnsByFunction: {
|
724
|
+
name: "AptosGetTxnsByFunction",
|
725
|
+
requestType: AptosGetTxnsByFunctionRequest,
|
726
|
+
requestStream: false,
|
727
|
+
responseType: AptosGetTxnsResponse,
|
728
|
+
responseStream: false,
|
729
|
+
options: {},
|
730
|
+
},
|
731
|
+
aptosGetTxnsByVersion: {
|
732
|
+
name: "AptosGetTxnsByVersion",
|
733
|
+
requestType: AptosGetTxnsByVersionRequest,
|
734
|
+
requestStream: false,
|
735
|
+
responseType: AptosGetTxnsResponse,
|
736
|
+
responseStream: false,
|
737
|
+
options: {},
|
738
|
+
},
|
739
|
+
aptosGetTxnsByEvent: {
|
740
|
+
name: "AptosGetTxnsByEvent",
|
741
|
+
requestType: AptosGetTxnsByEventRequest,
|
742
|
+
requestStream: false,
|
743
|
+
responseType: AptosGetTxnsResponse,
|
744
|
+
responseStream: false,
|
745
|
+
options: {},
|
746
|
+
},
|
747
|
+
aptosRefresh: {
|
748
|
+
name: "AptosRefresh",
|
749
|
+
requestType: AptosRefreshRequest,
|
750
|
+
requestStream: false,
|
751
|
+
responseType: VoidResponse,
|
752
|
+
responseStream: false,
|
753
|
+
options: {},
|
754
|
+
},
|
755
|
+
aptosSQLQuery: {
|
756
|
+
name: "AptosSQLQuery",
|
757
|
+
requestType: AptosSQLQueryRequest,
|
758
|
+
requestStream: false,
|
759
|
+
responseType: AptosGetTxnsResponse,
|
760
|
+
responseStream: false,
|
761
|
+
options: {},
|
762
|
+
},
|
763
|
+
},
|
764
|
+
} as const;
|
765
|
+
|
766
|
+
export interface AptosQueryServiceImplementation<CallContextExt = {}> {
|
767
|
+
aptosGetTxnsByFunction(
|
768
|
+
request: AptosGetTxnsByFunctionRequest,
|
769
|
+
context: CallContext & CallContextExt
|
770
|
+
): Promise<DeepPartial<AptosGetTxnsResponse>>;
|
771
|
+
aptosGetTxnsByVersion(
|
772
|
+
request: AptosGetTxnsByVersionRequest,
|
773
|
+
context: CallContext & CallContextExt
|
774
|
+
): Promise<DeepPartial<AptosGetTxnsResponse>>;
|
775
|
+
aptosGetTxnsByEvent(
|
776
|
+
request: AptosGetTxnsByEventRequest,
|
777
|
+
context: CallContext & CallContextExt
|
778
|
+
): Promise<DeepPartial<AptosGetTxnsResponse>>;
|
779
|
+
aptosRefresh(
|
780
|
+
request: AptosRefreshRequest,
|
781
|
+
context: CallContext & CallContextExt
|
782
|
+
): Promise<DeepPartial<VoidResponse>>;
|
783
|
+
aptosSQLQuery(
|
784
|
+
request: AptosSQLQueryRequest,
|
785
|
+
context: CallContext & CallContextExt
|
786
|
+
): Promise<DeepPartial<AptosGetTxnsResponse>>;
|
787
|
+
}
|
788
|
+
|
789
|
+
export interface AptosQueryClient<CallOptionsExt = {}> {
|
790
|
+
aptosGetTxnsByFunction(
|
791
|
+
request: DeepPartial<AptosGetTxnsByFunctionRequest>,
|
792
|
+
options?: CallOptions & CallOptionsExt
|
793
|
+
): Promise<AptosGetTxnsResponse>;
|
794
|
+
aptosGetTxnsByVersion(
|
795
|
+
request: DeepPartial<AptosGetTxnsByVersionRequest>,
|
796
|
+
options?: CallOptions & CallOptionsExt
|
797
|
+
): Promise<AptosGetTxnsResponse>;
|
798
|
+
aptosGetTxnsByEvent(
|
799
|
+
request: DeepPartial<AptosGetTxnsByEventRequest>,
|
800
|
+
options?: CallOptions & CallOptionsExt
|
801
|
+
): Promise<AptosGetTxnsResponse>;
|
802
|
+
aptosRefresh(
|
803
|
+
request: DeepPartial<AptosRefreshRequest>,
|
804
|
+
options?: CallOptions & CallOptionsExt
|
805
|
+
): Promise<VoidResponse>;
|
806
|
+
aptosSQLQuery(
|
807
|
+
request: DeepPartial<AptosSQLQueryRequest>,
|
808
|
+
options?: CallOptions & CallOptionsExt
|
809
|
+
): Promise<AptosGetTxnsResponse>;
|
810
|
+
}
|
811
|
+
|
812
|
+
type Builtin =
|
813
|
+
| Date
|
814
|
+
| Function
|
815
|
+
| Uint8Array
|
816
|
+
| string
|
817
|
+
| number
|
818
|
+
| boolean
|
819
|
+
| undefined;
|
820
|
+
|
821
|
+
type DeepPartial<T> = T extends Builtin
|
822
|
+
? T
|
823
|
+
: T extends Long
|
824
|
+
? string | number | Long
|
825
|
+
: T extends Array<infer U>
|
826
|
+
? Array<DeepPartial<U>>
|
827
|
+
: T extends ReadonlyArray<infer U>
|
828
|
+
? ReadonlyArray<DeepPartial<U>>
|
829
|
+
: T extends {}
|
830
|
+
? { [K in keyof T]?: DeepPartial<T[K]> }
|
831
|
+
: Partial<T>;
|
832
|
+
|
833
|
+
if (_m0.util.Long !== Long) {
|
834
|
+
_m0.util.Long = Long as any;
|
835
|
+
_m0.configure();
|
836
|
+
}
|
837
|
+
|
838
|
+
function isSet(value: any): boolean {
|
839
|
+
return value !== null && value !== undefined;
|
840
|
+
}
|