@apibara/evm 2.0.0 → 2.0.1-beta.1
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/dist/index.cjs +825 -498
- package/dist/index.d.cts +423 -357
- package/dist/index.d.mts +423 -357
- package/dist/index.d.ts +423 -357
- package/dist/index.mjs +823 -498
- package/package.json +20 -23
- package/src/block.ts +55 -49
- package/src/common.ts +1 -1
- package/src/filter.test.ts +8 -12
- package/src/filter.ts +88 -16
- package/src/proto/common.ts +1 -1
- package/src/proto/data.ts +517 -358
- package/src/proto/filter.ts +288 -118
- package/src/proto/google/protobuf/timestamp.ts +1 -1
- package/.turbo/turbo-build.log +0 -17
- package/CHANGELOG.md +0 -1
- package/LICENSE.txt +0 -202
- package/buf.gen.yaml +0 -14
- package/build.config.ts +0 -11
- package/proto/common.proto +0 -37
- package/proto/data.proto +0 -192
- package/proto/filter.proto +0 -61
- package/tsconfig.json +0 -11
package/src/proto/filter.ts
CHANGED
|
@@ -5,14 +5,103 @@
|
|
|
5
5
|
// source: filter.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { Address, B256 } from "./common";
|
|
8
|
+
import _m0 from "protobufjs/minimal.js";
|
|
9
|
+
import { Address, B256 } from "./common.js";
|
|
11
10
|
|
|
12
11
|
export const protobufPackage = "evm.v2";
|
|
13
12
|
|
|
14
13
|
/** EVM DNA definitions (filter). */
|
|
15
14
|
|
|
15
|
+
export enum HeaderFilter {
|
|
16
|
+
UNSPECIFIED = 0,
|
|
17
|
+
ALWAYS = 1,
|
|
18
|
+
ON_DATA = 2,
|
|
19
|
+
ON_DATA_OR_ON_NEW_BLOCK = 3,
|
|
20
|
+
UNRECOGNIZED = -1,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function headerFilterFromJSON(object: any): HeaderFilter {
|
|
24
|
+
switch (object) {
|
|
25
|
+
case 0:
|
|
26
|
+
case "HEADER_FILTER_UNSPECIFIED":
|
|
27
|
+
return HeaderFilter.UNSPECIFIED;
|
|
28
|
+
case 1:
|
|
29
|
+
case "HEADER_FILTER_ALWAYS":
|
|
30
|
+
return HeaderFilter.ALWAYS;
|
|
31
|
+
case 2:
|
|
32
|
+
case "HEADER_FILTER_ON_DATA":
|
|
33
|
+
return HeaderFilter.ON_DATA;
|
|
34
|
+
case 3:
|
|
35
|
+
case "HEADER_FILTER_ON_DATA_OR_ON_NEW_BLOCK":
|
|
36
|
+
return HeaderFilter.ON_DATA_OR_ON_NEW_BLOCK;
|
|
37
|
+
case -1:
|
|
38
|
+
case "UNRECOGNIZED":
|
|
39
|
+
default:
|
|
40
|
+
return HeaderFilter.UNRECOGNIZED;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function headerFilterToJSON(object: HeaderFilter): string {
|
|
45
|
+
switch (object) {
|
|
46
|
+
case HeaderFilter.UNSPECIFIED:
|
|
47
|
+
return "HEADER_FILTER_UNSPECIFIED";
|
|
48
|
+
case HeaderFilter.ALWAYS:
|
|
49
|
+
return "HEADER_FILTER_ALWAYS";
|
|
50
|
+
case HeaderFilter.ON_DATA:
|
|
51
|
+
return "HEADER_FILTER_ON_DATA";
|
|
52
|
+
case HeaderFilter.ON_DATA_OR_ON_NEW_BLOCK:
|
|
53
|
+
return "HEADER_FILTER_ON_DATA_OR_ON_NEW_BLOCK";
|
|
54
|
+
case HeaderFilter.UNRECOGNIZED:
|
|
55
|
+
default:
|
|
56
|
+
return "UNRECOGNIZED";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export enum TransactionStatusFilter {
|
|
61
|
+
UNSPECIFIED = 0,
|
|
62
|
+
SUCCEEDED = 1,
|
|
63
|
+
REVERTED = 2,
|
|
64
|
+
ALL = 3,
|
|
65
|
+
UNRECOGNIZED = -1,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function transactionStatusFilterFromJSON(object: any): TransactionStatusFilter {
|
|
69
|
+
switch (object) {
|
|
70
|
+
case 0:
|
|
71
|
+
case "TRANSACTION_STATUS_FILTER_UNSPECIFIED":
|
|
72
|
+
return TransactionStatusFilter.UNSPECIFIED;
|
|
73
|
+
case 1:
|
|
74
|
+
case "TRANSACTION_STATUS_FILTER_SUCCEEDED":
|
|
75
|
+
return TransactionStatusFilter.SUCCEEDED;
|
|
76
|
+
case 2:
|
|
77
|
+
case "TRANSACTION_STATUS_FILTER_REVERTED":
|
|
78
|
+
return TransactionStatusFilter.REVERTED;
|
|
79
|
+
case 3:
|
|
80
|
+
case "TRANSACTION_STATUS_FILTER_ALL":
|
|
81
|
+
return TransactionStatusFilter.ALL;
|
|
82
|
+
case -1:
|
|
83
|
+
case "UNRECOGNIZED":
|
|
84
|
+
default:
|
|
85
|
+
return TransactionStatusFilter.UNRECOGNIZED;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function transactionStatusFilterToJSON(object: TransactionStatusFilter): string {
|
|
90
|
+
switch (object) {
|
|
91
|
+
case TransactionStatusFilter.UNSPECIFIED:
|
|
92
|
+
return "TRANSACTION_STATUS_FILTER_UNSPECIFIED";
|
|
93
|
+
case TransactionStatusFilter.SUCCEEDED:
|
|
94
|
+
return "TRANSACTION_STATUS_FILTER_SUCCEEDED";
|
|
95
|
+
case TransactionStatusFilter.REVERTED:
|
|
96
|
+
return "TRANSACTION_STATUS_FILTER_REVERTED";
|
|
97
|
+
case TransactionStatusFilter.ALL:
|
|
98
|
+
return "TRANSACTION_STATUS_FILTER_ALL";
|
|
99
|
+
case TransactionStatusFilter.UNRECOGNIZED:
|
|
100
|
+
default:
|
|
101
|
+
return "UNRECOGNIZED";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
16
105
|
export interface Filter {
|
|
17
106
|
/** Include header. */
|
|
18
107
|
readonly header?:
|
|
@@ -30,21 +119,22 @@ export interface Filter {
|
|
|
30
119
|
readonly logs?: readonly LogFilter[] | undefined;
|
|
31
120
|
}
|
|
32
121
|
|
|
33
|
-
export interface HeaderFilter {
|
|
34
|
-
/** Always include header data. Defaults to `false`. */
|
|
35
|
-
readonly always?: boolean | undefined;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
122
|
export interface WithdrawalFilter {
|
|
123
|
+
readonly id?:
|
|
124
|
+
| number
|
|
125
|
+
| undefined;
|
|
39
126
|
/** Filter based on the validator index. */
|
|
40
127
|
readonly validatorIndex?:
|
|
41
|
-
|
|
|
128
|
+
| number
|
|
42
129
|
| undefined;
|
|
43
130
|
/** Filter based on the withdrawal's target address. */
|
|
44
131
|
readonly address?: Address | undefined;
|
|
45
132
|
}
|
|
46
133
|
|
|
47
134
|
export interface TransactionFilter {
|
|
135
|
+
readonly id?:
|
|
136
|
+
| number
|
|
137
|
+
| undefined;
|
|
48
138
|
/** Filter based on the transaction's sender address. */
|
|
49
139
|
readonly from?:
|
|
50
140
|
| Address
|
|
@@ -53,6 +143,18 @@ export interface TransactionFilter {
|
|
|
53
143
|
readonly to?:
|
|
54
144
|
| Address
|
|
55
145
|
| undefined;
|
|
146
|
+
/** / Only return `create` transactions. Defaults to `false`. */
|
|
147
|
+
readonly create?:
|
|
148
|
+
| boolean
|
|
149
|
+
| undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Filter based on the transaction status.
|
|
152
|
+
*
|
|
153
|
+
* Defaults to `Succeeded`.
|
|
154
|
+
*/
|
|
155
|
+
readonly transactionStatus?:
|
|
156
|
+
| TransactionStatusFilter
|
|
157
|
+
| undefined;
|
|
56
158
|
/** Flag to request the transaction's receipt. Defaults to `false`. */
|
|
57
159
|
readonly includeReceipt?:
|
|
58
160
|
| boolean
|
|
@@ -62,6 +164,9 @@ export interface TransactionFilter {
|
|
|
62
164
|
}
|
|
63
165
|
|
|
64
166
|
export interface LogFilter {
|
|
167
|
+
readonly id?:
|
|
168
|
+
| number
|
|
169
|
+
| undefined;
|
|
65
170
|
/** Filter based on the log's contract address. */
|
|
66
171
|
readonly address?:
|
|
67
172
|
| Address
|
|
@@ -78,12 +183,28 @@ export interface LogFilter {
|
|
|
78
183
|
readonly strict?:
|
|
79
184
|
| boolean
|
|
80
185
|
| undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Filter based on the transaction status.
|
|
188
|
+
*
|
|
189
|
+
* Defaults to `Succeeded`.
|
|
190
|
+
*/
|
|
191
|
+
readonly transactionStatus?:
|
|
192
|
+
| TransactionStatusFilter
|
|
193
|
+
| undefined;
|
|
81
194
|
/** Flag to request the log's transaction. Defaults to `false`. */
|
|
82
195
|
readonly includeTransaction?:
|
|
83
196
|
| boolean
|
|
84
197
|
| undefined;
|
|
85
198
|
/** Flag to request the log's receipt. Defaults to `false`. */
|
|
86
|
-
readonly includeReceipt?:
|
|
199
|
+
readonly includeReceipt?:
|
|
200
|
+
| boolean
|
|
201
|
+
| undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Include sibling logs, that is logs emitted by the same transaction.
|
|
204
|
+
*
|
|
205
|
+
* Defaults to false.
|
|
206
|
+
*/
|
|
207
|
+
readonly includeSiblings?: boolean | undefined;
|
|
87
208
|
}
|
|
88
209
|
|
|
89
210
|
/** Topic filter. */
|
|
@@ -93,13 +214,13 @@ export interface Topic {
|
|
|
93
214
|
}
|
|
94
215
|
|
|
95
216
|
function createBaseFilter(): Filter {
|
|
96
|
-
return { header:
|
|
217
|
+
return { header: 0, withdrawals: [], transactions: [], logs: [] };
|
|
97
218
|
}
|
|
98
219
|
|
|
99
220
|
export const Filter = {
|
|
100
221
|
encode(message: Filter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
101
|
-
if (message.header !== undefined) {
|
|
102
|
-
|
|
222
|
+
if (message.header !== undefined && message.header !== 0) {
|
|
223
|
+
writer.uint32(8).int32(message.header);
|
|
103
224
|
}
|
|
104
225
|
if (message.withdrawals !== undefined && message.withdrawals.length !== 0) {
|
|
105
226
|
for (const v of message.withdrawals) {
|
|
@@ -127,11 +248,11 @@ export const Filter = {
|
|
|
127
248
|
const tag = reader.uint32();
|
|
128
249
|
switch (tag >>> 3) {
|
|
129
250
|
case 1:
|
|
130
|
-
if (tag !==
|
|
251
|
+
if (tag !== 8) {
|
|
131
252
|
break;
|
|
132
253
|
}
|
|
133
254
|
|
|
134
|
-
message.header =
|
|
255
|
+
message.header = reader.int32() as any;
|
|
135
256
|
continue;
|
|
136
257
|
case 2:
|
|
137
258
|
if (tag !== 18) {
|
|
@@ -165,7 +286,7 @@ export const Filter = {
|
|
|
165
286
|
|
|
166
287
|
fromJSON(object: any): Filter {
|
|
167
288
|
return {
|
|
168
|
-
header: isSet(object.header) ?
|
|
289
|
+
header: isSet(object.header) ? headerFilterFromJSON(object.header) : 0,
|
|
169
290
|
withdrawals: globalThis.Array.isArray(object?.withdrawals)
|
|
170
291
|
? object.withdrawals.map((e: any) => WithdrawalFilter.fromJSON(e))
|
|
171
292
|
: [],
|
|
@@ -178,8 +299,8 @@ export const Filter = {
|
|
|
178
299
|
|
|
179
300
|
toJSON(message: Filter): unknown {
|
|
180
301
|
const obj: any = {};
|
|
181
|
-
if (message.header !== undefined) {
|
|
182
|
-
obj.header =
|
|
302
|
+
if (message.header !== undefined && message.header !== 0) {
|
|
303
|
+
obj.header = headerFilterToJSON(message.header);
|
|
183
304
|
}
|
|
184
305
|
if (message.withdrawals?.length) {
|
|
185
306
|
obj.withdrawals = message.withdrawals.map((e) => WithdrawalFilter.toJSON(e));
|
|
@@ -198,9 +319,7 @@ export const Filter = {
|
|
|
198
319
|
},
|
|
199
320
|
fromPartial(object: DeepPartial<Filter>): Filter {
|
|
200
321
|
const message = createBaseFilter() as any;
|
|
201
|
-
message.header =
|
|
202
|
-
? HeaderFilter.fromPartial(object.header)
|
|
203
|
-
: undefined;
|
|
322
|
+
message.header = object.header ?? 0;
|
|
204
323
|
message.withdrawals = object.withdrawals?.map((e) => WithdrawalFilter.fromPartial(e)) || [];
|
|
205
324
|
message.transactions = object.transactions?.map((e) => TransactionFilter.fromPartial(e)) || [];
|
|
206
325
|
message.logs = object.logs?.map((e) => LogFilter.fromPartial(e)) || [];
|
|
@@ -208,77 +327,20 @@ export const Filter = {
|
|
|
208
327
|
},
|
|
209
328
|
};
|
|
210
329
|
|
|
211
|
-
function createBaseHeaderFilter(): HeaderFilter {
|
|
212
|
-
return { always: undefined };
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export const HeaderFilter = {
|
|
216
|
-
encode(message: HeaderFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
217
|
-
if (message.always !== undefined) {
|
|
218
|
-
writer.uint32(8).bool(message.always);
|
|
219
|
-
}
|
|
220
|
-
return writer;
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): HeaderFilter {
|
|
224
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
225
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
226
|
-
const message = createBaseHeaderFilter() as any;
|
|
227
|
-
while (reader.pos < end) {
|
|
228
|
-
const tag = reader.uint32();
|
|
229
|
-
switch (tag >>> 3) {
|
|
230
|
-
case 1:
|
|
231
|
-
if (tag !== 8) {
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
message.always = reader.bool();
|
|
236
|
-
continue;
|
|
237
|
-
}
|
|
238
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
reader.skipType(tag & 7);
|
|
242
|
-
}
|
|
243
|
-
return message;
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
fromJSON(object: any): HeaderFilter {
|
|
247
|
-
return { always: isSet(object.always) ? globalThis.Boolean(object.always) : undefined };
|
|
248
|
-
},
|
|
249
|
-
|
|
250
|
-
toJSON(message: HeaderFilter): unknown {
|
|
251
|
-
const obj: any = {};
|
|
252
|
-
if (message.always !== undefined) {
|
|
253
|
-
obj.always = message.always;
|
|
254
|
-
}
|
|
255
|
-
return obj;
|
|
256
|
-
},
|
|
257
|
-
|
|
258
|
-
create(base?: DeepPartial<HeaderFilter>): HeaderFilter {
|
|
259
|
-
return HeaderFilter.fromPartial(base ?? {});
|
|
260
|
-
},
|
|
261
|
-
fromPartial(object: DeepPartial<HeaderFilter>): HeaderFilter {
|
|
262
|
-
const message = createBaseHeaderFilter() as any;
|
|
263
|
-
message.always = object.always ?? undefined;
|
|
264
|
-
return message;
|
|
265
|
-
},
|
|
266
|
-
};
|
|
267
|
-
|
|
268
330
|
function createBaseWithdrawalFilter(): WithdrawalFilter {
|
|
269
|
-
return { validatorIndex: undefined, address: undefined };
|
|
331
|
+
return { id: 0, validatorIndex: undefined, address: undefined };
|
|
270
332
|
}
|
|
271
333
|
|
|
272
334
|
export const WithdrawalFilter = {
|
|
273
335
|
encode(message: WithdrawalFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
336
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
337
|
+
writer.uint32(8).uint32(message.id);
|
|
338
|
+
}
|
|
274
339
|
if (message.validatorIndex !== undefined) {
|
|
275
|
-
|
|
276
|
-
throw new globalThis.Error("value provided for field message.validatorIndex of type uint64 too large");
|
|
277
|
-
}
|
|
278
|
-
writer.uint32(8).uint64(message.validatorIndex.toString());
|
|
340
|
+
writer.uint32(16).uint32(message.validatorIndex);
|
|
279
341
|
}
|
|
280
342
|
if (message.address !== undefined) {
|
|
281
|
-
Address.encode(message.address, writer.uint32(
|
|
343
|
+
Address.encode(message.address, writer.uint32(26).fork()).ldelim();
|
|
282
344
|
}
|
|
283
345
|
return writer;
|
|
284
346
|
},
|
|
@@ -295,10 +357,17 @@ export const WithdrawalFilter = {
|
|
|
295
357
|
break;
|
|
296
358
|
}
|
|
297
359
|
|
|
298
|
-
message.
|
|
360
|
+
message.id = reader.uint32();
|
|
299
361
|
continue;
|
|
300
362
|
case 2:
|
|
301
|
-
if (tag !==
|
|
363
|
+
if (tag !== 16) {
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
message.validatorIndex = reader.uint32();
|
|
368
|
+
continue;
|
|
369
|
+
case 3:
|
|
370
|
+
if (tag !== 26) {
|
|
302
371
|
break;
|
|
303
372
|
}
|
|
304
373
|
|
|
@@ -315,15 +384,19 @@ export const WithdrawalFilter = {
|
|
|
315
384
|
|
|
316
385
|
fromJSON(object: any): WithdrawalFilter {
|
|
317
386
|
return {
|
|
318
|
-
|
|
387
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
388
|
+
validatorIndex: isSet(object.validatorIndex) ? globalThis.Number(object.validatorIndex) : undefined,
|
|
319
389
|
address: isSet(object.address) ? Address.fromJSON(object.address) : undefined,
|
|
320
390
|
};
|
|
321
391
|
},
|
|
322
392
|
|
|
323
393
|
toJSON(message: WithdrawalFilter): unknown {
|
|
324
394
|
const obj: any = {};
|
|
395
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
396
|
+
obj.id = Math.round(message.id);
|
|
397
|
+
}
|
|
325
398
|
if (message.validatorIndex !== undefined) {
|
|
326
|
-
obj.validatorIndex = message.validatorIndex
|
|
399
|
+
obj.validatorIndex = Math.round(message.validatorIndex);
|
|
327
400
|
}
|
|
328
401
|
if (message.address !== undefined) {
|
|
329
402
|
obj.address = Address.toJSON(message.address);
|
|
@@ -336,6 +409,7 @@ export const WithdrawalFilter = {
|
|
|
336
409
|
},
|
|
337
410
|
fromPartial(object: DeepPartial<WithdrawalFilter>): WithdrawalFilter {
|
|
338
411
|
const message = createBaseWithdrawalFilter() as any;
|
|
412
|
+
message.id = object.id ?? 0;
|
|
339
413
|
message.validatorIndex = object.validatorIndex ?? undefined;
|
|
340
414
|
message.address = (object.address !== undefined && object.address !== null)
|
|
341
415
|
? Address.fromPartial(object.address)
|
|
@@ -345,22 +419,39 @@ export const WithdrawalFilter = {
|
|
|
345
419
|
};
|
|
346
420
|
|
|
347
421
|
function createBaseTransactionFilter(): TransactionFilter {
|
|
348
|
-
return {
|
|
422
|
+
return {
|
|
423
|
+
id: 0,
|
|
424
|
+
from: undefined,
|
|
425
|
+
to: undefined,
|
|
426
|
+
create: undefined,
|
|
427
|
+
transactionStatus: undefined,
|
|
428
|
+
includeReceipt: undefined,
|
|
429
|
+
includeLogs: undefined,
|
|
430
|
+
};
|
|
349
431
|
}
|
|
350
432
|
|
|
351
433
|
export const TransactionFilter = {
|
|
352
434
|
encode(message: TransactionFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
435
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
436
|
+
writer.uint32(8).uint32(message.id);
|
|
437
|
+
}
|
|
353
438
|
if (message.from !== undefined) {
|
|
354
|
-
Address.encode(message.from, writer.uint32(
|
|
439
|
+
Address.encode(message.from, writer.uint32(18).fork()).ldelim();
|
|
355
440
|
}
|
|
356
441
|
if (message.to !== undefined) {
|
|
357
|
-
Address.encode(message.to, writer.uint32(
|
|
442
|
+
Address.encode(message.to, writer.uint32(26).fork()).ldelim();
|
|
443
|
+
}
|
|
444
|
+
if (message.create !== undefined) {
|
|
445
|
+
writer.uint32(32).bool(message.create);
|
|
446
|
+
}
|
|
447
|
+
if (message.transactionStatus !== undefined) {
|
|
448
|
+
writer.uint32(40).int32(message.transactionStatus);
|
|
358
449
|
}
|
|
359
450
|
if (message.includeReceipt !== undefined) {
|
|
360
|
-
writer.uint32(
|
|
451
|
+
writer.uint32(48).bool(message.includeReceipt);
|
|
361
452
|
}
|
|
362
453
|
if (message.includeLogs !== undefined) {
|
|
363
|
-
writer.uint32(
|
|
454
|
+
writer.uint32(56).bool(message.includeLogs);
|
|
364
455
|
}
|
|
365
456
|
return writer;
|
|
366
457
|
},
|
|
@@ -373,31 +464,52 @@ export const TransactionFilter = {
|
|
|
373
464
|
const tag = reader.uint32();
|
|
374
465
|
switch (tag >>> 3) {
|
|
375
466
|
case 1:
|
|
376
|
-
if (tag !==
|
|
467
|
+
if (tag !== 8) {
|
|
377
468
|
break;
|
|
378
469
|
}
|
|
379
470
|
|
|
380
|
-
message.
|
|
471
|
+
message.id = reader.uint32();
|
|
381
472
|
continue;
|
|
382
473
|
case 2:
|
|
383
474
|
if (tag !== 18) {
|
|
384
475
|
break;
|
|
385
476
|
}
|
|
386
477
|
|
|
387
|
-
message.
|
|
478
|
+
message.from = Address.decode(reader, reader.uint32());
|
|
388
479
|
continue;
|
|
389
480
|
case 3:
|
|
390
|
-
if (tag !==
|
|
481
|
+
if (tag !== 26) {
|
|
391
482
|
break;
|
|
392
483
|
}
|
|
393
484
|
|
|
394
|
-
message.
|
|
485
|
+
message.to = Address.decode(reader, reader.uint32());
|
|
395
486
|
continue;
|
|
396
487
|
case 4:
|
|
397
488
|
if (tag !== 32) {
|
|
398
489
|
break;
|
|
399
490
|
}
|
|
400
491
|
|
|
492
|
+
message.create = reader.bool();
|
|
493
|
+
continue;
|
|
494
|
+
case 5:
|
|
495
|
+
if (tag !== 40) {
|
|
496
|
+
break;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
message.transactionStatus = reader.int32() as any;
|
|
500
|
+
continue;
|
|
501
|
+
case 6:
|
|
502
|
+
if (tag !== 48) {
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
message.includeReceipt = reader.bool();
|
|
507
|
+
continue;
|
|
508
|
+
case 7:
|
|
509
|
+
if (tag !== 56) {
|
|
510
|
+
break;
|
|
511
|
+
}
|
|
512
|
+
|
|
401
513
|
message.includeLogs = reader.bool();
|
|
402
514
|
continue;
|
|
403
515
|
}
|
|
@@ -411,8 +523,13 @@ export const TransactionFilter = {
|
|
|
411
523
|
|
|
412
524
|
fromJSON(object: any): TransactionFilter {
|
|
413
525
|
return {
|
|
526
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
414
527
|
from: isSet(object.from) ? Address.fromJSON(object.from) : undefined,
|
|
415
528
|
to: isSet(object.to) ? Address.fromJSON(object.to) : undefined,
|
|
529
|
+
create: isSet(object.create) ? globalThis.Boolean(object.create) : undefined,
|
|
530
|
+
transactionStatus: isSet(object.transactionStatus)
|
|
531
|
+
? transactionStatusFilterFromJSON(object.transactionStatus)
|
|
532
|
+
: undefined,
|
|
416
533
|
includeReceipt: isSet(object.includeReceipt) ? globalThis.Boolean(object.includeReceipt) : undefined,
|
|
417
534
|
includeLogs: isSet(object.includeLogs) ? globalThis.Boolean(object.includeLogs) : undefined,
|
|
418
535
|
};
|
|
@@ -420,12 +537,21 @@ export const TransactionFilter = {
|
|
|
420
537
|
|
|
421
538
|
toJSON(message: TransactionFilter): unknown {
|
|
422
539
|
const obj: any = {};
|
|
540
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
541
|
+
obj.id = Math.round(message.id);
|
|
542
|
+
}
|
|
423
543
|
if (message.from !== undefined) {
|
|
424
544
|
obj.from = Address.toJSON(message.from);
|
|
425
545
|
}
|
|
426
546
|
if (message.to !== undefined) {
|
|
427
547
|
obj.to = Address.toJSON(message.to);
|
|
428
548
|
}
|
|
549
|
+
if (message.create !== undefined) {
|
|
550
|
+
obj.create = message.create;
|
|
551
|
+
}
|
|
552
|
+
if (message.transactionStatus !== undefined) {
|
|
553
|
+
obj.transactionStatus = transactionStatusFilterToJSON(message.transactionStatus);
|
|
554
|
+
}
|
|
429
555
|
if (message.includeReceipt !== undefined) {
|
|
430
556
|
obj.includeReceipt = message.includeReceipt;
|
|
431
557
|
}
|
|
@@ -440,8 +566,11 @@ export const TransactionFilter = {
|
|
|
440
566
|
},
|
|
441
567
|
fromPartial(object: DeepPartial<TransactionFilter>): TransactionFilter {
|
|
442
568
|
const message = createBaseTransactionFilter() as any;
|
|
569
|
+
message.id = object.id ?? 0;
|
|
443
570
|
message.from = (object.from !== undefined && object.from !== null) ? Address.fromPartial(object.from) : undefined;
|
|
444
571
|
message.to = (object.to !== undefined && object.to !== null) ? Address.fromPartial(object.to) : undefined;
|
|
572
|
+
message.create = object.create ?? undefined;
|
|
573
|
+
message.transactionStatus = object.transactionStatus ?? undefined;
|
|
445
574
|
message.includeReceipt = object.includeReceipt ?? undefined;
|
|
446
575
|
message.includeLogs = object.includeLogs ?? undefined;
|
|
447
576
|
return message;
|
|
@@ -450,32 +579,44 @@ export const TransactionFilter = {
|
|
|
450
579
|
|
|
451
580
|
function createBaseLogFilter(): LogFilter {
|
|
452
581
|
return {
|
|
582
|
+
id: 0,
|
|
453
583
|
address: undefined,
|
|
454
584
|
topics: [],
|
|
455
585
|
strict: undefined,
|
|
586
|
+
transactionStatus: undefined,
|
|
456
587
|
includeTransaction: undefined,
|
|
457
588
|
includeReceipt: undefined,
|
|
589
|
+
includeSiblings: undefined,
|
|
458
590
|
};
|
|
459
591
|
}
|
|
460
592
|
|
|
461
593
|
export const LogFilter = {
|
|
462
594
|
encode(message: LogFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
595
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
596
|
+
writer.uint32(8).uint32(message.id);
|
|
597
|
+
}
|
|
463
598
|
if (message.address !== undefined) {
|
|
464
|
-
Address.encode(message.address, writer.uint32(
|
|
599
|
+
Address.encode(message.address, writer.uint32(18).fork()).ldelim();
|
|
465
600
|
}
|
|
466
601
|
if (message.topics !== undefined && message.topics.length !== 0) {
|
|
467
602
|
for (const v of message.topics) {
|
|
468
|
-
Topic.encode(v!, writer.uint32(
|
|
603
|
+
Topic.encode(v!, writer.uint32(26).fork()).ldelim();
|
|
469
604
|
}
|
|
470
605
|
}
|
|
471
606
|
if (message.strict !== undefined) {
|
|
472
|
-
writer.uint32(
|
|
607
|
+
writer.uint32(32).bool(message.strict);
|
|
608
|
+
}
|
|
609
|
+
if (message.transactionStatus !== undefined) {
|
|
610
|
+
writer.uint32(40).int32(message.transactionStatus);
|
|
473
611
|
}
|
|
474
612
|
if (message.includeTransaction !== undefined) {
|
|
475
|
-
writer.uint32(
|
|
613
|
+
writer.uint32(48).bool(message.includeTransaction);
|
|
476
614
|
}
|
|
477
615
|
if (message.includeReceipt !== undefined) {
|
|
478
|
-
writer.uint32(
|
|
616
|
+
writer.uint32(56).bool(message.includeReceipt);
|
|
617
|
+
}
|
|
618
|
+
if (message.includeSiblings !== undefined) {
|
|
619
|
+
writer.uint32(64).bool(message.includeSiblings);
|
|
479
620
|
}
|
|
480
621
|
return writer;
|
|
481
622
|
},
|
|
@@ -488,40 +629,61 @@ export const LogFilter = {
|
|
|
488
629
|
const tag = reader.uint32();
|
|
489
630
|
switch (tag >>> 3) {
|
|
490
631
|
case 1:
|
|
491
|
-
if (tag !==
|
|
632
|
+
if (tag !== 8) {
|
|
492
633
|
break;
|
|
493
634
|
}
|
|
494
635
|
|
|
495
|
-
message.
|
|
636
|
+
message.id = reader.uint32();
|
|
496
637
|
continue;
|
|
497
638
|
case 2:
|
|
498
639
|
if (tag !== 18) {
|
|
499
640
|
break;
|
|
500
641
|
}
|
|
501
642
|
|
|
502
|
-
message.
|
|
643
|
+
message.address = Address.decode(reader, reader.uint32());
|
|
503
644
|
continue;
|
|
504
645
|
case 3:
|
|
505
|
-
if (tag !==
|
|
646
|
+
if (tag !== 26) {
|
|
506
647
|
break;
|
|
507
648
|
}
|
|
508
649
|
|
|
509
|
-
message.
|
|
650
|
+
message.topics!.push(Topic.decode(reader, reader.uint32()));
|
|
510
651
|
continue;
|
|
511
652
|
case 4:
|
|
512
653
|
if (tag !== 32) {
|
|
513
654
|
break;
|
|
514
655
|
}
|
|
515
656
|
|
|
516
|
-
message.
|
|
657
|
+
message.strict = reader.bool();
|
|
517
658
|
continue;
|
|
518
659
|
case 5:
|
|
519
660
|
if (tag !== 40) {
|
|
520
661
|
break;
|
|
521
662
|
}
|
|
522
663
|
|
|
664
|
+
message.transactionStatus = reader.int32() as any;
|
|
665
|
+
continue;
|
|
666
|
+
case 6:
|
|
667
|
+
if (tag !== 48) {
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
message.includeTransaction = reader.bool();
|
|
672
|
+
continue;
|
|
673
|
+
case 7:
|
|
674
|
+
if (tag !== 56) {
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
|
|
523
678
|
message.includeReceipt = reader.bool();
|
|
524
679
|
continue;
|
|
680
|
+
case 8:
|
|
681
|
+
if (tag !== 64) {
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
message.includeSiblings = reader.bool();
|
|
686
|
+
continue;
|
|
525
687
|
}
|
|
526
688
|
if ((tag & 7) === 4 || tag === 0) {
|
|
527
689
|
break;
|
|
@@ -533,16 +695,24 @@ export const LogFilter = {
|
|
|
533
695
|
|
|
534
696
|
fromJSON(object: any): LogFilter {
|
|
535
697
|
return {
|
|
698
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
536
699
|
address: isSet(object.address) ? Address.fromJSON(object.address) : undefined,
|
|
537
700
|
topics: globalThis.Array.isArray(object?.topics) ? object.topics.map((e: any) => Topic.fromJSON(e)) : [],
|
|
538
701
|
strict: isSet(object.strict) ? globalThis.Boolean(object.strict) : undefined,
|
|
702
|
+
transactionStatus: isSet(object.transactionStatus)
|
|
703
|
+
? transactionStatusFilterFromJSON(object.transactionStatus)
|
|
704
|
+
: undefined,
|
|
539
705
|
includeTransaction: isSet(object.includeTransaction) ? globalThis.Boolean(object.includeTransaction) : undefined,
|
|
540
706
|
includeReceipt: isSet(object.includeReceipt) ? globalThis.Boolean(object.includeReceipt) : undefined,
|
|
707
|
+
includeSiblings: isSet(object.includeSiblings) ? globalThis.Boolean(object.includeSiblings) : undefined,
|
|
541
708
|
};
|
|
542
709
|
},
|
|
543
710
|
|
|
544
711
|
toJSON(message: LogFilter): unknown {
|
|
545
712
|
const obj: any = {};
|
|
713
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
714
|
+
obj.id = Math.round(message.id);
|
|
715
|
+
}
|
|
546
716
|
if (message.address !== undefined) {
|
|
547
717
|
obj.address = Address.toJSON(message.address);
|
|
548
718
|
}
|
|
@@ -552,12 +722,18 @@ export const LogFilter = {
|
|
|
552
722
|
if (message.strict !== undefined) {
|
|
553
723
|
obj.strict = message.strict;
|
|
554
724
|
}
|
|
725
|
+
if (message.transactionStatus !== undefined) {
|
|
726
|
+
obj.transactionStatus = transactionStatusFilterToJSON(message.transactionStatus);
|
|
727
|
+
}
|
|
555
728
|
if (message.includeTransaction !== undefined) {
|
|
556
729
|
obj.includeTransaction = message.includeTransaction;
|
|
557
730
|
}
|
|
558
731
|
if (message.includeReceipt !== undefined) {
|
|
559
732
|
obj.includeReceipt = message.includeReceipt;
|
|
560
733
|
}
|
|
734
|
+
if (message.includeSiblings !== undefined) {
|
|
735
|
+
obj.includeSiblings = message.includeSiblings;
|
|
736
|
+
}
|
|
561
737
|
return obj;
|
|
562
738
|
},
|
|
563
739
|
|
|
@@ -566,13 +742,16 @@ export const LogFilter = {
|
|
|
566
742
|
},
|
|
567
743
|
fromPartial(object: DeepPartial<LogFilter>): LogFilter {
|
|
568
744
|
const message = createBaseLogFilter() as any;
|
|
745
|
+
message.id = object.id ?? 0;
|
|
569
746
|
message.address = (object.address !== undefined && object.address !== null)
|
|
570
747
|
? Address.fromPartial(object.address)
|
|
571
748
|
: undefined;
|
|
572
749
|
message.topics = object.topics?.map((e) => Topic.fromPartial(e)) || [];
|
|
573
750
|
message.strict = object.strict ?? undefined;
|
|
751
|
+
message.transactionStatus = object.transactionStatus ?? undefined;
|
|
574
752
|
message.includeTransaction = object.includeTransaction ?? undefined;
|
|
575
753
|
message.includeReceipt = object.includeReceipt ?? undefined;
|
|
754
|
+
message.includeSiblings = object.includeSiblings ?? undefined;
|
|
576
755
|
return message;
|
|
577
756
|
},
|
|
578
757
|
};
|
|
@@ -644,15 +823,6 @@ export type DeepPartial<T> = T extends Builtin ? T
|
|
|
644
823
|
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
645
824
|
: Partial<T>;
|
|
646
825
|
|
|
647
|
-
function longToBigint(long: Long) {
|
|
648
|
-
return BigInt(long.toString());
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
if (_m0.util.Long !== Long) {
|
|
652
|
-
_m0.util.Long = Long as any;
|
|
653
|
-
_m0.configure();
|
|
654
|
-
}
|
|
655
|
-
|
|
656
826
|
function isSet(value: any): boolean {
|
|
657
827
|
return value !== null && value !== undefined;
|
|
658
828
|
}
|