@hugomrdias/foxer 0.1.9 → 0.1.11
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/CHANGELOG.md +16 -0
- package/README.md +71 -1
- package/dist/config/env.d.ts +1 -1
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +2 -2
- package/dist/config/env.js.map +1 -1
- package/dist/db/actions/blocks.d.ts +9 -6
- package/dist/db/actions/blocks.d.ts.map +1 -1
- package/dist/db/actions/blocks.js +39 -43
- package/dist/db/actions/blocks.js.map +1 -1
- package/dist/db/client.d.ts +1 -1
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +5 -1
- package/dist/db/client.js.map +1 -1
- package/dist/db/column-types.d.ts +2 -2
- package/dist/db/column-types.d.ts.map +1 -1
- package/dist/db/column-types.js +11 -3
- package/dist/db/column-types.js.map +1 -1
- package/dist/db/schema/blocks.d.ts +16 -16
- package/dist/db/schema/index.d.ts +44 -44
- package/dist/db/schema/transactions.d.ts +6 -6
- package/dist/db/schema/transactions.d.ts.map +1 -1
- package/dist/db/schema/transactions.js +3 -1
- package/dist/db/schema/transactions.js.map +1 -1
- package/dist/hooks/registry.d.ts +3 -3
- package/dist/hooks/registry.d.ts.map +1 -1
- package/dist/indexer/backfill.d.ts.map +1 -1
- package/dist/indexer/backfill.js +19 -12
- package/dist/indexer/backfill.js.map +1 -1
- package/dist/indexer/process-block.d.ts +4 -4
- package/dist/indexer/process-block.d.ts.map +1 -1
- package/dist/indexer/process-block.js +4 -29
- package/dist/indexer/process-block.js.map +1 -1
- package/dist/indexer/queue-block.d.ts.map +1 -1
- package/dist/indexer/queue-block.js +19 -1
- package/dist/indexer/queue-block.js.map +1 -1
- package/dist/indexer/reorg.d.ts +2 -2
- package/dist/indexer/reorg.d.ts.map +1 -1
- package/dist/rpc/get-logs.js +1 -1
- package/dist/rpc/get-logs.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -9
- package/src/config/env.ts +2 -2
- package/src/db/actions/blocks.ts +51 -51
- package/src/db/client.ts +5 -1
- package/src/db/column-types.ts +17 -6
- package/src/db/schema/transactions.ts +3 -1
- package/src/hooks/registry.ts +3 -3
- package/src/indexer/backfill.ts +28 -10
- package/src/indexer/process-block.ts +10 -39
- package/src/indexer/queue-block.ts +24 -1
- package/src/indexer/reorg.ts +2 -2
- package/src/rpc/get-logs.ts +1 -1
- package/src/types.ts +2 -0
|
@@ -89,13 +89,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
89
89
|
logsBloom: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
90
90
|
dataType: "custom";
|
|
91
91
|
data: `0x${string}`;
|
|
92
|
-
driverParam:
|
|
92
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
93
93
|
}>>, {
|
|
94
94
|
name: string;
|
|
95
95
|
tableName: "blocks";
|
|
96
96
|
dataType: "custom";
|
|
97
97
|
data: `0x${string}`;
|
|
98
|
-
driverParam:
|
|
98
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
99
99
|
notNull: true;
|
|
100
100
|
hasDefault: false;
|
|
101
101
|
isPrimaryKey: false;
|
|
@@ -184,13 +184,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
184
184
|
nonce: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
185
185
|
dataType: "custom";
|
|
186
186
|
data: `0x${string}`;
|
|
187
|
-
driverParam:
|
|
187
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
188
188
|
}>>, {
|
|
189
189
|
name: string;
|
|
190
190
|
tableName: "blocks";
|
|
191
191
|
dataType: "custom";
|
|
192
192
|
data: `0x${string}`;
|
|
193
|
-
driverParam:
|
|
193
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
194
194
|
notNull: true;
|
|
195
195
|
hasDefault: false;
|
|
196
196
|
isPrimaryKey: false;
|
|
@@ -203,13 +203,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
203
203
|
mixHash: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
204
204
|
dataType: "custom";
|
|
205
205
|
data: `0x${string}`;
|
|
206
|
-
driverParam:
|
|
206
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
207
207
|
}>>, {
|
|
208
208
|
name: string;
|
|
209
209
|
tableName: "blocks";
|
|
210
210
|
dataType: "custom";
|
|
211
211
|
data: `0x${string}`;
|
|
212
|
-
driverParam:
|
|
212
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
213
213
|
notNull: true;
|
|
214
214
|
hasDefault: false;
|
|
215
215
|
isPrimaryKey: false;
|
|
@@ -222,13 +222,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
222
222
|
stateRoot: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
223
223
|
dataType: "custom";
|
|
224
224
|
data: `0x${string}`;
|
|
225
|
-
driverParam:
|
|
225
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
226
226
|
}>>, {
|
|
227
227
|
name: string;
|
|
228
228
|
tableName: "blocks";
|
|
229
229
|
dataType: "custom";
|
|
230
230
|
data: `0x${string}`;
|
|
231
|
-
driverParam:
|
|
231
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
232
232
|
notNull: true;
|
|
233
233
|
hasDefault: false;
|
|
234
234
|
isPrimaryKey: false;
|
|
@@ -241,13 +241,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
241
241
|
receiptsRoot: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
242
242
|
dataType: "custom";
|
|
243
243
|
data: `0x${string}`;
|
|
244
|
-
driverParam:
|
|
244
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
245
245
|
}>>, {
|
|
246
246
|
name: string;
|
|
247
247
|
tableName: "blocks";
|
|
248
248
|
dataType: "custom";
|
|
249
249
|
data: `0x${string}`;
|
|
250
|
-
driverParam:
|
|
250
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
251
251
|
notNull: true;
|
|
252
252
|
hasDefault: false;
|
|
253
253
|
isPrimaryKey: false;
|
|
@@ -260,13 +260,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
260
260
|
transactionsRoot: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
261
261
|
dataType: "custom";
|
|
262
262
|
data: `0x${string}`;
|
|
263
|
-
driverParam:
|
|
263
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
264
264
|
}>>, {
|
|
265
265
|
name: string;
|
|
266
266
|
tableName: "blocks";
|
|
267
267
|
dataType: "custom";
|
|
268
268
|
data: `0x${string}`;
|
|
269
|
-
driverParam:
|
|
269
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
270
270
|
notNull: true;
|
|
271
271
|
hasDefault: false;
|
|
272
272
|
isPrimaryKey: false;
|
|
@@ -279,13 +279,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
279
279
|
sha3Uncles: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
280
280
|
dataType: "custom";
|
|
281
281
|
data: `0x${string}`;
|
|
282
|
-
driverParam:
|
|
282
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
283
283
|
}>>, {
|
|
284
284
|
name: string;
|
|
285
285
|
tableName: "blocks";
|
|
286
286
|
dataType: "custom";
|
|
287
287
|
data: `0x${string}`;
|
|
288
|
-
driverParam:
|
|
288
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
289
289
|
notNull: true;
|
|
290
290
|
hasDefault: false;
|
|
291
291
|
isPrimaryKey: false;
|
|
@@ -355,13 +355,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
355
355
|
extraData: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
356
356
|
dataType: "custom";
|
|
357
357
|
data: `0x${string}`;
|
|
358
|
-
driverParam:
|
|
358
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
359
359
|
}>>, {
|
|
360
360
|
name: string;
|
|
361
361
|
tableName: "blocks";
|
|
362
362
|
dataType: "custom";
|
|
363
363
|
data: `0x${string}`;
|
|
364
|
-
driverParam:
|
|
364
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
365
365
|
notNull: true;
|
|
366
366
|
hasDefault: false;
|
|
367
367
|
isPrimaryKey: false;
|
|
@@ -491,13 +491,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
491
491
|
input: import("drizzle-orm/pg-core").PgBuildColumn<"transactions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
492
492
|
dataType: "custom";
|
|
493
493
|
data: `0x${string}`;
|
|
494
|
-
driverParam:
|
|
494
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
495
495
|
}>>, {
|
|
496
496
|
name: string;
|
|
497
497
|
tableName: "transactions";
|
|
498
498
|
dataType: "custom";
|
|
499
499
|
data: `0x${string}`;
|
|
500
|
-
driverParam:
|
|
500
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
501
501
|
notNull: true;
|
|
502
502
|
hasDefault: false;
|
|
503
503
|
isPrimaryKey: false;
|
|
@@ -544,13 +544,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
544
544
|
r: import("drizzle-orm/pg-core").PgBuildColumn<"transactions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
545
545
|
dataType: "custom";
|
|
546
546
|
data: `0x${string}`;
|
|
547
|
-
driverParam:
|
|
547
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
548
548
|
}>>, {
|
|
549
549
|
name: string;
|
|
550
550
|
tableName: "transactions";
|
|
551
551
|
dataType: "custom";
|
|
552
552
|
data: `0x${string}`;
|
|
553
|
-
driverParam:
|
|
553
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
554
554
|
notNull: true;
|
|
555
555
|
hasDefault: false;
|
|
556
556
|
isPrimaryKey: false;
|
|
@@ -563,13 +563,13 @@ export declare const relations: import("drizzle-orm").ExtractTablesWithRelations
|
|
|
563
563
|
s: import("drizzle-orm/pg-core").PgBuildColumn<"transactions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
564
564
|
dataType: "custom";
|
|
565
565
|
data: `0x${string}`;
|
|
566
|
-
driverParam:
|
|
566
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
567
567
|
}>>, {
|
|
568
568
|
name: string;
|
|
569
569
|
tableName: "transactions";
|
|
570
570
|
dataType: "custom";
|
|
571
571
|
data: `0x${string}`;
|
|
572
|
-
driverParam:
|
|
572
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
573
573
|
notNull: true;
|
|
574
574
|
hasDefault: false;
|
|
575
575
|
isPrimaryKey: false;
|
|
@@ -792,13 +792,13 @@ export declare const schema: {
|
|
|
792
792
|
logsBloom: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
793
793
|
dataType: "custom";
|
|
794
794
|
data: `0x${string}`;
|
|
795
|
-
driverParam:
|
|
795
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
796
796
|
}>>, {
|
|
797
797
|
name: string;
|
|
798
798
|
tableName: "blocks";
|
|
799
799
|
dataType: "custom";
|
|
800
800
|
data: `0x${string}`;
|
|
801
|
-
driverParam:
|
|
801
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
802
802
|
notNull: true;
|
|
803
803
|
hasDefault: false;
|
|
804
804
|
isPrimaryKey: false;
|
|
@@ -887,13 +887,13 @@ export declare const schema: {
|
|
|
887
887
|
nonce: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
888
888
|
dataType: "custom";
|
|
889
889
|
data: `0x${string}`;
|
|
890
|
-
driverParam:
|
|
890
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
891
891
|
}>>, {
|
|
892
892
|
name: string;
|
|
893
893
|
tableName: "blocks";
|
|
894
894
|
dataType: "custom";
|
|
895
895
|
data: `0x${string}`;
|
|
896
|
-
driverParam:
|
|
896
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
897
897
|
notNull: true;
|
|
898
898
|
hasDefault: false;
|
|
899
899
|
isPrimaryKey: false;
|
|
@@ -906,13 +906,13 @@ export declare const schema: {
|
|
|
906
906
|
mixHash: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
907
907
|
dataType: "custom";
|
|
908
908
|
data: `0x${string}`;
|
|
909
|
-
driverParam:
|
|
909
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
910
910
|
}>>, {
|
|
911
911
|
name: string;
|
|
912
912
|
tableName: "blocks";
|
|
913
913
|
dataType: "custom";
|
|
914
914
|
data: `0x${string}`;
|
|
915
|
-
driverParam:
|
|
915
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
916
916
|
notNull: true;
|
|
917
917
|
hasDefault: false;
|
|
918
918
|
isPrimaryKey: false;
|
|
@@ -925,13 +925,13 @@ export declare const schema: {
|
|
|
925
925
|
stateRoot: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
926
926
|
dataType: "custom";
|
|
927
927
|
data: `0x${string}`;
|
|
928
|
-
driverParam:
|
|
928
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
929
929
|
}>>, {
|
|
930
930
|
name: string;
|
|
931
931
|
tableName: "blocks";
|
|
932
932
|
dataType: "custom";
|
|
933
933
|
data: `0x${string}`;
|
|
934
|
-
driverParam:
|
|
934
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
935
935
|
notNull: true;
|
|
936
936
|
hasDefault: false;
|
|
937
937
|
isPrimaryKey: false;
|
|
@@ -944,13 +944,13 @@ export declare const schema: {
|
|
|
944
944
|
receiptsRoot: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
945
945
|
dataType: "custom";
|
|
946
946
|
data: `0x${string}`;
|
|
947
|
-
driverParam:
|
|
947
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
948
948
|
}>>, {
|
|
949
949
|
name: string;
|
|
950
950
|
tableName: "blocks";
|
|
951
951
|
dataType: "custom";
|
|
952
952
|
data: `0x${string}`;
|
|
953
|
-
driverParam:
|
|
953
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
954
954
|
notNull: true;
|
|
955
955
|
hasDefault: false;
|
|
956
956
|
isPrimaryKey: false;
|
|
@@ -963,13 +963,13 @@ export declare const schema: {
|
|
|
963
963
|
transactionsRoot: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
964
964
|
dataType: "custom";
|
|
965
965
|
data: `0x${string}`;
|
|
966
|
-
driverParam:
|
|
966
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
967
967
|
}>>, {
|
|
968
968
|
name: string;
|
|
969
969
|
tableName: "blocks";
|
|
970
970
|
dataType: "custom";
|
|
971
971
|
data: `0x${string}`;
|
|
972
|
-
driverParam:
|
|
972
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
973
973
|
notNull: true;
|
|
974
974
|
hasDefault: false;
|
|
975
975
|
isPrimaryKey: false;
|
|
@@ -982,13 +982,13 @@ export declare const schema: {
|
|
|
982
982
|
sha3Uncles: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
983
983
|
dataType: "custom";
|
|
984
984
|
data: `0x${string}`;
|
|
985
|
-
driverParam:
|
|
985
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
986
986
|
}>>, {
|
|
987
987
|
name: string;
|
|
988
988
|
tableName: "blocks";
|
|
989
989
|
dataType: "custom";
|
|
990
990
|
data: `0x${string}`;
|
|
991
|
-
driverParam:
|
|
991
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
992
992
|
notNull: true;
|
|
993
993
|
hasDefault: false;
|
|
994
994
|
isPrimaryKey: false;
|
|
@@ -1058,13 +1058,13 @@ export declare const schema: {
|
|
|
1058
1058
|
extraData: import("drizzle-orm/pg-core").PgBuildColumn<"blocks", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
1059
1059
|
dataType: "custom";
|
|
1060
1060
|
data: `0x${string}`;
|
|
1061
|
-
driverParam:
|
|
1061
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
1062
1062
|
}>>, {
|
|
1063
1063
|
name: string;
|
|
1064
1064
|
tableName: "blocks";
|
|
1065
1065
|
dataType: "custom";
|
|
1066
1066
|
data: `0x${string}`;
|
|
1067
|
-
driverParam:
|
|
1067
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
1068
1068
|
notNull: true;
|
|
1069
1069
|
hasDefault: false;
|
|
1070
1070
|
isPrimaryKey: false;
|
|
@@ -1194,13 +1194,13 @@ export declare const schema: {
|
|
|
1194
1194
|
input: import("drizzle-orm/pg-core").PgBuildColumn<"transactions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
1195
1195
|
dataType: "custom";
|
|
1196
1196
|
data: `0x${string}`;
|
|
1197
|
-
driverParam:
|
|
1197
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
1198
1198
|
}>>, {
|
|
1199
1199
|
name: string;
|
|
1200
1200
|
tableName: "transactions";
|
|
1201
1201
|
dataType: "custom";
|
|
1202
1202
|
data: `0x${string}`;
|
|
1203
|
-
driverParam:
|
|
1203
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
1204
1204
|
notNull: true;
|
|
1205
1205
|
hasDefault: false;
|
|
1206
1206
|
isPrimaryKey: false;
|
|
@@ -1247,13 +1247,13 @@ export declare const schema: {
|
|
|
1247
1247
|
r: import("drizzle-orm/pg-core").PgBuildColumn<"transactions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
1248
1248
|
dataType: "custom";
|
|
1249
1249
|
data: `0x${string}`;
|
|
1250
|
-
driverParam:
|
|
1250
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
1251
1251
|
}>>, {
|
|
1252
1252
|
name: string;
|
|
1253
1253
|
tableName: "transactions";
|
|
1254
1254
|
dataType: "custom";
|
|
1255
1255
|
data: `0x${string}`;
|
|
1256
|
-
driverParam:
|
|
1256
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
1257
1257
|
notNull: true;
|
|
1258
1258
|
hasDefault: false;
|
|
1259
1259
|
isPrimaryKey: false;
|
|
@@ -1266,13 +1266,13 @@ export declare const schema: {
|
|
|
1266
1266
|
s: import("drizzle-orm/pg-core").PgBuildColumn<"transactions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
1267
1267
|
dataType: "custom";
|
|
1268
1268
|
data: `0x${string}`;
|
|
1269
|
-
driverParam:
|
|
1269
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
1270
1270
|
}>>, {
|
|
1271
1271
|
name: string;
|
|
1272
1272
|
tableName: "transactions";
|
|
1273
1273
|
dataType: "custom";
|
|
1274
1274
|
data: `0x${string}`;
|
|
1275
|
-
driverParam:
|
|
1275
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
1276
1276
|
notNull: true;
|
|
1277
1277
|
hasDefault: false;
|
|
1278
1278
|
isPrimaryKey: false;
|
|
@@ -117,13 +117,13 @@ export declare const transactions: import("drizzle-orm/pg-core").PgTableWithColu
|
|
|
117
117
|
input: import("drizzle-orm/pg-core").PgBuildColumn<"transactions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
118
118
|
dataType: "custom";
|
|
119
119
|
data: `0x${string}`;
|
|
120
|
-
driverParam:
|
|
120
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
121
121
|
}>>, {
|
|
122
122
|
name: string;
|
|
123
123
|
tableName: "transactions";
|
|
124
124
|
dataType: "custom";
|
|
125
125
|
data: `0x${string}`;
|
|
126
|
-
driverParam:
|
|
126
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
127
127
|
notNull: true;
|
|
128
128
|
hasDefault: false;
|
|
129
129
|
isPrimaryKey: false;
|
|
@@ -170,13 +170,13 @@ export declare const transactions: import("drizzle-orm/pg-core").PgTableWithColu
|
|
|
170
170
|
r: import("drizzle-orm/pg-core").PgBuildColumn<"transactions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
171
171
|
dataType: "custom";
|
|
172
172
|
data: `0x${string}`;
|
|
173
|
-
driverParam:
|
|
173
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
174
174
|
}>>, {
|
|
175
175
|
name: string;
|
|
176
176
|
tableName: "transactions";
|
|
177
177
|
dataType: "custom";
|
|
178
178
|
data: `0x${string}`;
|
|
179
|
-
driverParam:
|
|
179
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
180
180
|
notNull: true;
|
|
181
181
|
hasDefault: false;
|
|
182
182
|
isPrimaryKey: false;
|
|
@@ -189,13 +189,13 @@ export declare const transactions: import("drizzle-orm/pg-core").PgTableWithColu
|
|
|
189
189
|
s: import("drizzle-orm/pg-core").PgBuildColumn<"transactions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
190
190
|
dataType: "custom";
|
|
191
191
|
data: `0x${string}`;
|
|
192
|
-
driverParam:
|
|
192
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
193
193
|
}>>, {
|
|
194
194
|
name: string;
|
|
195
195
|
tableName: "transactions";
|
|
196
196
|
dataType: "custom";
|
|
197
197
|
data: `0x${string}`;
|
|
198
|
-
driverParam:
|
|
198
|
+
driverParam: Uint8Array<ArrayBufferLike>;
|
|
199
199
|
notNull: true;
|
|
200
200
|
hasDefault: false;
|
|
201
201
|
isPrimaryKey: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/db/schema/transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAItC,eAAO,MAAM,mBAAmB,8FAM9B,CAAA;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/db/schema/transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAItC,eAAO,MAAM,mBAAmB,8FAM9B,CAAA;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BxB,CAAA"}
|
|
@@ -28,6 +28,8 @@ export const transactions = pgTable('transactions', {
|
|
|
28
28
|
accessList: jsonb().$type(),
|
|
29
29
|
}, (table) => [
|
|
30
30
|
index('transactions_block_number_index').on(table.blockNumber),
|
|
31
|
-
index('
|
|
31
|
+
index('transactions_to_block_number_index')
|
|
32
|
+
.on(table.to, table.blockNumber)
|
|
33
|
+
.concurrently(),
|
|
32
34
|
]);
|
|
33
35
|
//# sourceMappingURL=transactions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/db/schema/transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAG5E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE5E,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,kBAAkB,EAAE;IAC5D,QAAQ;IACR,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CACjC,cAAc,EACd;IACE,IAAI,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE;IAC/B,gBAAgB,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE;IACrC,SAAS,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE;IACzB,EAAE,EAAE,OAAO,EAAE;IACb,KAAK,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE;IACxB,KAAK,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE;IAC5B,KAAK,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE;IAC1B,CAAC,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE;IACpB,CAAC,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE;IACpB,CAAC,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE;IACxB,IAAI,EAAE,mBAAmB,EAAE,CAAC,OAAO,EAAE;IACrC,GAAG,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE;IAC1B,QAAQ,EAA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EAAE,CAAC,OAAO,EAAE;IACpB,CAAC,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE;IACxB,IAAI,EAAE,mBAAmB,EAAE,CAAC,OAAO,EAAE;IACrC,GAAG,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE;IAC1B,QAAQ,EAAE,SAAS,EAAE;IACrB,YAAY,EAAE,SAAS,EAAE;IACzB,oBAAoB,EAAE,SAAS,EAAE;IACjC,UAAU,EAAE,KAAK,EAAE,CAAC,KAAK,EAAc;CACxC,EACD,CAAC,KAAK,EAAE,EAAE,CAAC;IACT,KAAK,CAAC,iCAAiC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC;IAC9D,KAAK,CAAC,oCAAoC,CAAC;SACxC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,WAAW,CAAC;SAC/B,YAAY,EAAE;CAClB,CACF,CAAA"}
|
package/dist/hooks/registry.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { AnyRelations, EmptyRelations } from 'drizzle-orm/relations';
|
|
|
2
2
|
import type { GetEventArgs, Log } from 'viem';
|
|
3
3
|
import type { InternalConfig } from '../config/config';
|
|
4
4
|
import type { Database } from '../db/client';
|
|
5
|
-
import type {
|
|
5
|
+
import type { EncodedBlock, EncodedTransaction } from '../types';
|
|
6
6
|
import type { Logger } from '../utils/logger';
|
|
7
7
|
import type { ContractAbiByEventKey, ContractAbiEventByEventKey, ContractsConfig, EventKey, EventNameFromEventKey, MergedContractEvents } from '../utils/types';
|
|
8
8
|
export type HookContext<TSchema extends Record<string, unknown> = Record<string, unknown>, TRelations extends AnyRelations = EmptyRelations> = {
|
|
@@ -17,7 +17,7 @@ export type DecodedEvent<C extends ContractsConfig<NonNullable<unknown>>, Event
|
|
|
17
17
|
Required: true;
|
|
18
18
|
}>;
|
|
19
19
|
log: Log<bigint, number, false, ContractAbiEventByEventKey<C, Event>>;
|
|
20
|
-
block:
|
|
20
|
+
block: EncodedBlock;
|
|
21
21
|
transaction: EncodedTransaction;
|
|
22
22
|
};
|
|
23
23
|
export type EventHook<C extends ContractsConfig<NonNullable<unknown>>, Event extends EventKey = EventKey, TSchema extends Record<string, unknown> = Record<string, unknown>, TRelations extends AnyRelations = EmptyRelations> = (args: {
|
|
@@ -44,7 +44,7 @@ export declare class HookRegistry<C extends ContractsConfig<NonNullable<unknown>
|
|
|
44
44
|
Required: true;
|
|
45
45
|
}>;
|
|
46
46
|
log: Log<bigint, number, false, ContractAbiEventByEventKey<C, K>>;
|
|
47
|
-
block:
|
|
47
|
+
block: EncodedBlock;
|
|
48
48
|
transaction: EncodedTransaction;
|
|
49
49
|
context: HookContext<TSchema, TRelations>;
|
|
50
50
|
}): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/hooks/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/hooks/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;A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kB,CAAA;QAC/B,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;KAC1C,GAAG,OAAO,CAAC,IAAI,CAAC;CAsBlB;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAM,GACP,EAAE;IACD,MAAM,EAAE,cAAc,CAAA;CACvB,GAAG,YAAY,CAIf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backfill.d.ts","sourceRoot":"","sources":["../../src/indexer/backfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backfill.d.ts","sourceRoot":"","sources":["../../src/indexer/backfill.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAE1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAIhD;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACtC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,cAAc,CAAA;IACtB,EAAE,EAAE,QAAQ,CAAC,OAAO,MAAM,EAAE,OAAO,SAAS,CAAC,CAAA;IAC7C,QAAQ,EAAE,YAAY,CAAA;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA0HlB"}
|
package/dist/indexer/backfill.js
CHANGED
|
@@ -39,32 +39,39 @@ export async function runBackfill(args) {
|
|
|
39
39
|
batchBlockNumbers.push(blockNumber);
|
|
40
40
|
blockNumber += 1n;
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
const logsByBlock = await getLogsInRange({
|
|
43
|
+
logger,
|
|
44
|
+
client,
|
|
45
|
+
addresses: windowContracts.addresses,
|
|
46
|
+
events: windowContracts.eventAbis,
|
|
47
|
+
fromBlock: cursor,
|
|
48
|
+
toBlock,
|
|
49
|
+
});
|
|
50
|
+
const logsTxsSet = new Set();
|
|
51
|
+
for (const logs of logsByBlock.values()) {
|
|
52
|
+
for (const log of logs) {
|
|
53
|
+
logsTxsSet.add(log.transactionHash);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const { blocks: blocksByNumber, transactions: transactionsMap } = await getBlocksInRange(logger, db, batchBlockNumbers, client, Array.from(logsTxsSet));
|
|
53
57
|
let blockIndex = 0;
|
|
54
58
|
const endClockBatch = startClock();
|
|
55
59
|
await withTransaction(db, async (tx) => {
|
|
56
60
|
while (blockIndex < batchBlockNumbers.length) {
|
|
57
61
|
const blockNumber = batchBlockNumbers[blockIndex];
|
|
58
62
|
const prefetchedBlock = blocksByNumber.get(blockNumber);
|
|
63
|
+
if (!prefetchedBlock) {
|
|
64
|
+
throw new Error(`Block ${blockNumber} not found`);
|
|
65
|
+
}
|
|
59
66
|
await processBlock({
|
|
60
67
|
logger,
|
|
61
68
|
config,
|
|
62
69
|
db: tx,
|
|
63
70
|
client,
|
|
64
71
|
registry,
|
|
65
|
-
blockNumber,
|
|
66
72
|
logs: logsByBlock.get(blockNumber) ?? [],
|
|
67
73
|
block: prefetchedBlock,
|
|
74
|
+
transactionsMap,
|
|
68
75
|
type: 'backfill',
|
|
69
76
|
contracts: windowContracts,
|
|
70
77
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backfill.js","sourceRoot":"","sources":["../../src/indexer/backfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backfill.js","sourceRoot":"","sources":["../../src/indexer/backfill.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAuB,MAAM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,CAAC,SAAS,CAAC,MAAM;YAC3C,UAAU,EAAE,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SAC/C,EACD,0BAA0B,CAC3B,CAAA;QACD,MAAM,GAAG,OAAO,GAAG,EAAE,CAAA;IACvB,CAAC;IAED,MAAM,CAAC,IAAI,CACT,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAClE,oBAAoB,CACrB,CAAA;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -3,7 +3,7 @@ import type { FilteredContracts, InternalConfig } from '../config/config.ts';
|
|
|
3
3
|
import type { Database } from '../db/client.ts';
|
|
4
4
|
import type { relations, schema } from '../db/schema/index.ts';
|
|
5
5
|
import type { HookRegistry } from '../hooks/registry.ts';
|
|
6
|
-
import type {
|
|
6
|
+
import type { EncodedBlock, TransactionsMap } from '../types';
|
|
7
7
|
import type { Logger } from '../utils/logger.ts';
|
|
8
8
|
export type ProcessBlockResult = {
|
|
9
9
|
status: 'processed';
|
|
@@ -20,9 +20,9 @@ export declare function processBlock(args: {
|
|
|
20
20
|
db: Database<typeof schema, typeof relations>;
|
|
21
21
|
client: PublicClient;
|
|
22
22
|
registry: HookRegistry<NonNullable<unknown>>;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
logs: Log<bigint, number, false, AbiEvent>[];
|
|
24
|
+
block: EncodedBlock;
|
|
25
|
+
transactionsMap: TransactionsMap;
|
|
26
26
|
type: 'backfill' | 'live';
|
|
27
27
|
contracts: FilteredContracts;
|
|
28
28
|
}): Promise<ProcessBlockResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-block.d.ts","sourceRoot":"","sources":["../../src/indexer/process-block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;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CAAA;IAC5C,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAA;IAC5C,KAAK,EAAE,YAAY,CAAA;IACnB,eAAe,EAAE,eAAe,CAAA;IAChC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAA;IACzB,SAAS,EAAE,iBAAiB,CAAA;CAC7B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAmF9B"}
|
|
@@ -1,37 +1,11 @@
|
|
|
1
1
|
import { cacheBlockAndTransactions } from "../db/actions/blocks.js";
|
|
2
2
|
import { withTransaction } from "../db/transaction.js";
|
|
3
|
-
import { safeGetBlock } from "../rpc/get-block.js";
|
|
4
3
|
import { ensureParentContinuity } from "./reorg.js";
|
|
5
4
|
/**
|
|
6
5
|
* Processes one block: continuity check, event writes, and optional cursor update.
|
|
7
6
|
*/
|
|
8
7
|
export async function processBlock(args) {
|
|
9
|
-
const { logger, config, db, client, registry,
|
|
10
|
-
const transactionByHash = new Map();
|
|
11
|
-
let block;
|
|
12
|
-
let logs;
|
|
13
|
-
if (prefetchedBlock) {
|
|
14
|
-
block = prefetchedBlock;
|
|
15
|
-
}
|
|
16
|
-
if (prefetchedLogs) {
|
|
17
|
-
logs = prefetchedLogs;
|
|
18
|
-
}
|
|
19
|
-
if (!block || !logs) {
|
|
20
|
-
const [blockResult, logsResult] = await Promise.all([
|
|
21
|
-
safeGetBlock({ client, blockNumber, db }),
|
|
22
|
-
client.getLogs({
|
|
23
|
-
address: contracts.addresses,
|
|
24
|
-
events: contracts.eventAbis,
|
|
25
|
-
fromBlock: blockNumber,
|
|
26
|
-
toBlock: blockNumber,
|
|
27
|
-
}),
|
|
28
|
-
]);
|
|
29
|
-
block = blockResult;
|
|
30
|
-
logs = logsResult;
|
|
31
|
-
}
|
|
32
|
-
for (const tx of block.transactions) {
|
|
33
|
-
transactionByHash.set(tx.hash, tx);
|
|
34
|
-
}
|
|
8
|
+
const { logger, config, db, client, registry, block, transactionsMap, logs, type, contracts, } = args;
|
|
35
9
|
if (type === 'live') {
|
|
36
10
|
const rewindTo = await ensureParentContinuity({
|
|
37
11
|
logger,
|
|
@@ -47,7 +21,8 @@ export async function processBlock(args) {
|
|
|
47
21
|
if (type === 'live') {
|
|
48
22
|
await cacheBlockAndTransactions({
|
|
49
23
|
db: tx,
|
|
50
|
-
block,
|
|
24
|
+
blocks: [block],
|
|
25
|
+
transactions: Array.from(transactionsMap.values()),
|
|
51
26
|
logger,
|
|
52
27
|
});
|
|
53
28
|
}
|
|
@@ -61,7 +36,7 @@ export async function processBlock(args) {
|
|
|
61
36
|
if (!contracts.eventNames.has(eventName)) {
|
|
62
37
|
continue;
|
|
63
38
|
}
|
|
64
|
-
const transaction =
|
|
39
|
+
const transaction = transactionsMap.get(log.transactionHash);
|
|
65
40
|
if (!transaction) {
|
|
66
41
|
logger.debug({ transactionHash: log.transactionHash }, 'transaction not found in block transaction list');
|
|
67
42
|
continue;
|