@apibara/starknet 2.1.0-beta.2 → 2.1.0-beta.20
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 +1221 -232
- package/dist/index.d.cts +2062 -1461
- package/dist/index.d.mts +2062 -1461
- package/dist/index.d.ts +2062 -1461
- package/dist/index.mjs +1213 -233
- package/package.json +2 -2
- package/src/block.ts +220 -0
- package/src/filter.ts +34 -0
- package/src/proto/data.ts +1081 -1
- package/src/proto/filter.ts +76 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apibara/starknet",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"vitest": "^1.6.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@apibara/protocol": "2.1.0-beta.
|
|
45
|
+
"@apibara/protocol": "2.1.0-beta.20",
|
|
46
46
|
"@effect/schema": "^0.67.15",
|
|
47
47
|
"@scure/starknet": "^1.1.0",
|
|
48
48
|
"abi-wan-kanabi": "^2.2.4",
|
package/src/block.ts
CHANGED
|
@@ -14,6 +14,8 @@ export const ResourcePrice = Schema.Struct({
|
|
|
14
14
|
priceInWei: Schema.optional(FieldElement),
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
+
export type ResourcePrice = typeof ResourcePrice.Type;
|
|
18
|
+
|
|
17
19
|
/** How data is posted to L1. */
|
|
18
20
|
export const L1DataAvailabilityMode = Schema.transform(
|
|
19
21
|
Schema.Enums(proto.data.L1DataAvailabilityMode),
|
|
@@ -35,6 +37,8 @@ export const L1DataAvailabilityMode = Schema.transform(
|
|
|
35
37
|
},
|
|
36
38
|
);
|
|
37
39
|
|
|
40
|
+
export type L1DataAvailabilityMode = typeof L1DataAvailabilityMode.Type;
|
|
41
|
+
|
|
38
42
|
export const TransactionStatus = Schema.transform(
|
|
39
43
|
Schema.Enums(proto.data.TransactionStatus),
|
|
40
44
|
Schema.Literal("unknown", "succeeded", "reverted"),
|
|
@@ -75,16 +79,22 @@ export const U128 = Schema.transform(
|
|
|
75
79
|
},
|
|
76
80
|
);
|
|
77
81
|
|
|
82
|
+
export type U128 = typeof U128.Type;
|
|
83
|
+
|
|
78
84
|
export const ResourceBounds = Schema.Struct({
|
|
79
85
|
maxAmount: Schema.BigIntFromSelf,
|
|
80
86
|
maxPricePerUnit: U128,
|
|
81
87
|
});
|
|
82
88
|
|
|
89
|
+
export type ResourceBounds = typeof ResourceBounds.Type;
|
|
90
|
+
|
|
83
91
|
export const ResourceBoundsMapping = Schema.Struct({
|
|
84
92
|
l1Gas: ResourceBounds,
|
|
85
93
|
l2Gas: ResourceBounds,
|
|
86
94
|
});
|
|
87
95
|
|
|
96
|
+
export type ResourceBoundsMapping = typeof ResourceBoundsMapping.Type;
|
|
97
|
+
|
|
88
98
|
export const DataAvailabilityMode = Schema.transform(
|
|
89
99
|
Schema.Enums(proto.data.DataAvailabilityMode),
|
|
90
100
|
Schema.Literal("l1", "l2", "unknown"),
|
|
@@ -105,6 +115,8 @@ export const DataAvailabilityMode = Schema.transform(
|
|
|
105
115
|
},
|
|
106
116
|
);
|
|
107
117
|
|
|
118
|
+
export type DataAvailabilityMode = typeof DataAvailabilityMode.Type;
|
|
119
|
+
|
|
108
120
|
/** Starknet block header.
|
|
109
121
|
*
|
|
110
122
|
* @prop blockHash The hash of the block.
|
|
@@ -160,6 +172,8 @@ export const InvokeTransactionV0 = Schema.Struct({
|
|
|
160
172
|
}),
|
|
161
173
|
});
|
|
162
174
|
|
|
175
|
+
export type InvokeTransactionV0 = typeof InvokeTransactionV0.Type;
|
|
176
|
+
|
|
163
177
|
export const InvokeTransactionV1 = Schema.Struct({
|
|
164
178
|
_tag: tag("invokeV1"),
|
|
165
179
|
invokeV1: Schema.Struct({
|
|
@@ -171,6 +185,8 @@ export const InvokeTransactionV1 = Schema.Struct({
|
|
|
171
185
|
}),
|
|
172
186
|
});
|
|
173
187
|
|
|
188
|
+
export type InvokeTransactionV1 = typeof InvokeTransactionV1.Type;
|
|
189
|
+
|
|
174
190
|
export const InvokeTransactionV3 = Schema.Struct({
|
|
175
191
|
_tag: tag("invokeV3"),
|
|
176
192
|
invokeV3: Schema.Struct({
|
|
@@ -187,6 +203,8 @@ export const InvokeTransactionV3 = Schema.Struct({
|
|
|
187
203
|
}),
|
|
188
204
|
});
|
|
189
205
|
|
|
206
|
+
export type InvokeTransactionV3 = typeof InvokeTransactionV3.Type;
|
|
207
|
+
|
|
190
208
|
export const L1HandlerTransaction = Schema.Struct({
|
|
191
209
|
_tag: tag("l1Handler"),
|
|
192
210
|
l1Handler: Schema.Struct({
|
|
@@ -197,6 +215,8 @@ export const L1HandlerTransaction = Schema.Struct({
|
|
|
197
215
|
}),
|
|
198
216
|
});
|
|
199
217
|
|
|
218
|
+
export type L1HandlerTransaction = typeof L1HandlerTransaction.Type;
|
|
219
|
+
|
|
200
220
|
export const DeployTransaction = Schema.Struct({
|
|
201
221
|
_tag: tag("deploy"),
|
|
202
222
|
deploy: Schema.Struct({
|
|
@@ -206,6 +226,8 @@ export const DeployTransaction = Schema.Struct({
|
|
|
206
226
|
}),
|
|
207
227
|
});
|
|
208
228
|
|
|
229
|
+
export type DeployTransaction = typeof DeployTransaction.Type;
|
|
230
|
+
|
|
209
231
|
export const DeclareTransactionV0 = Schema.Struct({
|
|
210
232
|
_tag: tag("declareV0"),
|
|
211
233
|
declareV0: Schema.Struct({
|
|
@@ -216,6 +238,8 @@ export const DeclareTransactionV0 = Schema.Struct({
|
|
|
216
238
|
}),
|
|
217
239
|
});
|
|
218
240
|
|
|
241
|
+
export type DeclareTransactionV0 = typeof DeclareTransactionV0.Type;
|
|
242
|
+
|
|
219
243
|
export const DeclareTransactionV1 = Schema.Struct({
|
|
220
244
|
_tag: tag("declareV1"),
|
|
221
245
|
declareV1: Schema.Struct({
|
|
@@ -227,6 +251,8 @@ export const DeclareTransactionV1 = Schema.Struct({
|
|
|
227
251
|
}),
|
|
228
252
|
});
|
|
229
253
|
|
|
254
|
+
export type DeclareTransactionV1 = typeof DeclareTransactionV1.Type;
|
|
255
|
+
|
|
230
256
|
export const DeclareTransactionV2 = Schema.Struct({
|
|
231
257
|
_tag: tag("declareV2"),
|
|
232
258
|
declareV2: Schema.Struct({
|
|
@@ -239,6 +265,8 @@ export const DeclareTransactionV2 = Schema.Struct({
|
|
|
239
265
|
}),
|
|
240
266
|
});
|
|
241
267
|
|
|
268
|
+
export type DeclareTransactionV2 = typeof DeclareTransactionV2.Type;
|
|
269
|
+
|
|
242
270
|
export const DeclareTransactionV3 = Schema.Struct({
|
|
243
271
|
_tag: tag("declareV3"),
|
|
244
272
|
declareV3: Schema.Struct({
|
|
@@ -256,6 +284,8 @@ export const DeclareTransactionV3 = Schema.Struct({
|
|
|
256
284
|
}),
|
|
257
285
|
});
|
|
258
286
|
|
|
287
|
+
export type DeclareTransactionV3 = typeof DeclareTransactionV3.Type;
|
|
288
|
+
|
|
259
289
|
export const DeployAccountTransactionV1 = Schema.Struct({
|
|
260
290
|
_tag: tag("deployAccountV1"),
|
|
261
291
|
deployAccountV1: Schema.Struct({
|
|
@@ -268,6 +298,8 @@ export const DeployAccountTransactionV1 = Schema.Struct({
|
|
|
268
298
|
}),
|
|
269
299
|
});
|
|
270
300
|
|
|
301
|
+
export type DeployAccountTransactionV1 = typeof DeployAccountTransactionV1.Type;
|
|
302
|
+
|
|
271
303
|
export const DeployAccountTransactionV3 = Schema.Struct({
|
|
272
304
|
_tag: tag("deployAccountV3"),
|
|
273
305
|
deployAccountV3: Schema.Struct({
|
|
@@ -284,6 +316,8 @@ export const DeployAccountTransactionV3 = Schema.Struct({
|
|
|
284
316
|
}),
|
|
285
317
|
});
|
|
286
318
|
|
|
319
|
+
export type DeployAccountTransactionV3 = typeof DeployAccountTransactionV3.Type;
|
|
320
|
+
|
|
287
321
|
/** A transaction.
|
|
288
322
|
*
|
|
289
323
|
* @prop meta Transaction metadata.
|
|
@@ -328,11 +362,15 @@ export const PriceUnit = Schema.transform(
|
|
|
328
362
|
},
|
|
329
363
|
);
|
|
330
364
|
|
|
365
|
+
export type PriceUnit = typeof PriceUnit.Type;
|
|
366
|
+
|
|
331
367
|
export const FeePayment = Schema.Struct({
|
|
332
368
|
amount: FieldElement,
|
|
333
369
|
unit: PriceUnit,
|
|
334
370
|
});
|
|
335
371
|
|
|
372
|
+
export type FeePayment = typeof FeePayment.Type;
|
|
373
|
+
|
|
336
374
|
export const ComputationResources = Schema.Struct({
|
|
337
375
|
steps: Schema.BigIntFromSelf,
|
|
338
376
|
memoryHoles: Schema.optional(Schema.BigIntFromSelf),
|
|
@@ -346,21 +384,29 @@ export const ComputationResources = Schema.Struct({
|
|
|
346
384
|
segmentArenaBuiltin: Schema.optional(Schema.BigIntFromSelf),
|
|
347
385
|
});
|
|
348
386
|
|
|
387
|
+
export type ComputationResources = typeof ComputationResources.Type;
|
|
388
|
+
|
|
349
389
|
export const DataAvailabilityResources = Schema.Struct({
|
|
350
390
|
l1Gas: Schema.BigIntFromSelf,
|
|
351
391
|
l1DataGas: Schema.BigIntFromSelf,
|
|
352
392
|
});
|
|
353
393
|
|
|
394
|
+
export type DataAvailabilityResources = typeof DataAvailabilityResources.Type;
|
|
395
|
+
|
|
354
396
|
export const ExecutionResources = Schema.Struct({
|
|
355
397
|
computation: ComputationResources,
|
|
356
398
|
dataAvailability: DataAvailabilityResources,
|
|
357
399
|
});
|
|
358
400
|
|
|
401
|
+
export type ExecutionResources = typeof ExecutionResources.Type;
|
|
402
|
+
|
|
359
403
|
export const ExecutionSucceeded = Schema.Struct({
|
|
360
404
|
_tag: tag("succeeded"),
|
|
361
405
|
succeeded: Schema.Struct({}),
|
|
362
406
|
});
|
|
363
407
|
|
|
408
|
+
export type ExecutionSucceeded = typeof ExecutionSucceeded.Type;
|
|
409
|
+
|
|
364
410
|
export const ExecutionReverted = Schema.Struct({
|
|
365
411
|
_tag: tag("reverted"),
|
|
366
412
|
reverted: Schema.Struct({
|
|
@@ -368,6 +414,8 @@ export const ExecutionReverted = Schema.Struct({
|
|
|
368
414
|
}),
|
|
369
415
|
});
|
|
370
416
|
|
|
417
|
+
export type ExecutionReverted = typeof ExecutionReverted.Type;
|
|
418
|
+
|
|
371
419
|
/** Common fields for all transaction receipts. */
|
|
372
420
|
export const TransactionReceiptMeta = Schema.Struct({
|
|
373
421
|
transactionIndex: Schema.Number,
|
|
@@ -377,11 +425,15 @@ export const TransactionReceiptMeta = Schema.Struct({
|
|
|
377
425
|
executionResult: Schema.Union(ExecutionSucceeded, ExecutionReverted),
|
|
378
426
|
});
|
|
379
427
|
|
|
428
|
+
export type TransactionReceiptMeta = typeof TransactionReceiptMeta.Type;
|
|
429
|
+
|
|
380
430
|
export const InvokeTransactionReceipt = Schema.Struct({
|
|
381
431
|
_tag: tag("invoke"),
|
|
382
432
|
invoke: Schema.Struct({}),
|
|
383
433
|
});
|
|
384
434
|
|
|
435
|
+
export type InvokeTransactionReceipt = typeof InvokeTransactionReceipt.Type;
|
|
436
|
+
|
|
385
437
|
export const L1HandlerTransactionReceipt = Schema.Struct({
|
|
386
438
|
_tag: tag("l1Handler"),
|
|
387
439
|
l1Handler: Schema.Struct({
|
|
@@ -389,11 +441,16 @@ export const L1HandlerTransactionReceipt = Schema.Struct({
|
|
|
389
441
|
}),
|
|
390
442
|
});
|
|
391
443
|
|
|
444
|
+
export type L1HandlerTransactionReceipt =
|
|
445
|
+
typeof L1HandlerTransactionReceipt.Type;
|
|
446
|
+
|
|
392
447
|
export const DeclareTransactionReceipt = Schema.Struct({
|
|
393
448
|
_tag: tag("declare"),
|
|
394
449
|
declare: Schema.Struct({}),
|
|
395
450
|
});
|
|
396
451
|
|
|
452
|
+
export type DeclareTransactionReceipt = typeof DeclareTransactionReceipt.Type;
|
|
453
|
+
|
|
397
454
|
export const DeployTransactionReceipt = Schema.Struct({
|
|
398
455
|
_tag: tag("deploy"),
|
|
399
456
|
deploy: Schema.Struct({
|
|
@@ -401,6 +458,8 @@ export const DeployTransactionReceipt = Schema.Struct({
|
|
|
401
458
|
}),
|
|
402
459
|
});
|
|
403
460
|
|
|
461
|
+
export type DeployTransactionReceipt = typeof DeployTransactionReceipt.Type;
|
|
462
|
+
|
|
404
463
|
export const DeployAccountTransactionReceipt = Schema.Struct({
|
|
405
464
|
_tag: tag("deployAccount"),
|
|
406
465
|
deployAccount: Schema.Struct({
|
|
@@ -408,6 +467,9 @@ export const DeployAccountTransactionReceipt = Schema.Struct({
|
|
|
408
467
|
}),
|
|
409
468
|
});
|
|
410
469
|
|
|
470
|
+
export type DeployAccountTransactionReceipt =
|
|
471
|
+
typeof DeployAccountTransactionReceipt.Type;
|
|
472
|
+
|
|
411
473
|
/** A transaction receipt.
|
|
412
474
|
*
|
|
413
475
|
* @prop meta Transaction receipt metadata.
|
|
@@ -572,6 +634,162 @@ export const NonceUpdate = Schema.Struct({
|
|
|
572
634
|
|
|
573
635
|
export type NonceUpdate = typeof NonceUpdate.Type;
|
|
574
636
|
|
|
637
|
+
/** Trace call type. */
|
|
638
|
+
export const CallType = Schema.transform(
|
|
639
|
+
Schema.Enums(proto.data.CallType),
|
|
640
|
+
Schema.Literal("libraryCall", "call", "delegate", "unknown"),
|
|
641
|
+
{
|
|
642
|
+
decode(value) {
|
|
643
|
+
const enumMap = {
|
|
644
|
+
[proto.data.CallType.LIBRARY_CALL]: "libraryCall",
|
|
645
|
+
[proto.data.CallType.CALL]: "call",
|
|
646
|
+
[proto.data.CallType.DELEGATE]: "delegate",
|
|
647
|
+
[proto.data.CallType.UNSPECIFIED]: "unknown",
|
|
648
|
+
[proto.data.CallType.UNRECOGNIZED]: "unknown",
|
|
649
|
+
} as const;
|
|
650
|
+
|
|
651
|
+
return enumMap[value] ?? "unknown";
|
|
652
|
+
},
|
|
653
|
+
encode(value) {
|
|
654
|
+
throw new Error("encode: not implemented");
|
|
655
|
+
},
|
|
656
|
+
},
|
|
657
|
+
);
|
|
658
|
+
|
|
659
|
+
/** A function invocation.
|
|
660
|
+
*
|
|
661
|
+
* @prop contractAddress The contract address.
|
|
662
|
+
* @prop entryPointSelector The entry point selector.
|
|
663
|
+
* @prop calldata The calldata.
|
|
664
|
+
* @prop callerAddress The caller address.
|
|
665
|
+
* @prop classHash The class hash.
|
|
666
|
+
* @prop callType The call type.
|
|
667
|
+
* @prop result The function invocation result.
|
|
668
|
+
* @prop calls The nested function invocations.
|
|
669
|
+
* @prop events The events index in the current transaction.
|
|
670
|
+
* @prop messages The messages index in the current transaction.
|
|
671
|
+
*/
|
|
672
|
+
export class FunctionInvocation extends Schema.Class<FunctionInvocation>(
|
|
673
|
+
"FunctionInvocation",
|
|
674
|
+
)({
|
|
675
|
+
contractAddress: FieldElement,
|
|
676
|
+
entryPointSelector: FieldElement,
|
|
677
|
+
calldata: Schema.Array(FieldElement),
|
|
678
|
+
callerAddress: FieldElement,
|
|
679
|
+
classHash: FieldElement,
|
|
680
|
+
callType: CallType,
|
|
681
|
+
result: Schema.Array(FieldElement),
|
|
682
|
+
calls: Schema.suspend(
|
|
683
|
+
// biome-ignore lint/suspicious/noExplicitAny: not possible otherwise
|
|
684
|
+
(): Schema.Schema<any> => Schema.Array(FunctionInvocation),
|
|
685
|
+
),
|
|
686
|
+
events: Schema.Array(Schema.Number),
|
|
687
|
+
messages: Schema.Array(Schema.Number),
|
|
688
|
+
}) {}
|
|
689
|
+
|
|
690
|
+
/** A successful invocation of the __execute__ call.
|
|
691
|
+
*
|
|
692
|
+
* @prop success The call.
|
|
693
|
+
*/
|
|
694
|
+
export const ExecuteInvocationSuccess = Schema.Struct({
|
|
695
|
+
_tag: tag("success"),
|
|
696
|
+
success: FunctionInvocation,
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
/** A failed invocation of the __execute__ call.
|
|
700
|
+
*
|
|
701
|
+
* @prop reason The reason for the failure.
|
|
702
|
+
*/
|
|
703
|
+
export const ExecuteInvocationReverted = Schema.Struct({
|
|
704
|
+
_tag: tag("reverted"),
|
|
705
|
+
reverted: Schema.Struct({
|
|
706
|
+
reason: Schema.optional(Schema.String),
|
|
707
|
+
}),
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
/** Trace for invoke transactions.
|
|
711
|
+
*
|
|
712
|
+
* @prop validateInvocation The __validate__ call.
|
|
713
|
+
* @prop executeInvocation The __execute__ call.
|
|
714
|
+
* @prop feeTransferInvocation The __fee_transfer__ call.
|
|
715
|
+
*/
|
|
716
|
+
export const InvokeTransactionTrace = Schema.Struct({
|
|
717
|
+
_tag: tag("invoke"),
|
|
718
|
+
invoke: Schema.Struct({
|
|
719
|
+
validateInvocation: Schema.optional(FunctionInvocation),
|
|
720
|
+
executeInvocation: Schema.Union(
|
|
721
|
+
ExecuteInvocationReverted,
|
|
722
|
+
ExecuteInvocationSuccess,
|
|
723
|
+
),
|
|
724
|
+
feeTransferInvocation: Schema.optional(FunctionInvocation),
|
|
725
|
+
}),
|
|
726
|
+
});
|
|
727
|
+
|
|
728
|
+
export type InvokeTransactionTrace = typeof InvokeTransactionTrace.Type;
|
|
729
|
+
|
|
730
|
+
/** Trace for declare transactions.
|
|
731
|
+
*
|
|
732
|
+
* @prop validateInvocation The __validate__ call.
|
|
733
|
+
* @prop feeTransferInvocation The __fee_transfer__ call.
|
|
734
|
+
*/
|
|
735
|
+
export const DeclareTransactionTrace = Schema.Struct({
|
|
736
|
+
_tag: tag("declare"),
|
|
737
|
+
declare: Schema.Struct({
|
|
738
|
+
validateInvocation: Schema.optional(FunctionInvocation),
|
|
739
|
+
feeTransferInvocation: Schema.optional(FunctionInvocation),
|
|
740
|
+
}),
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
export type DeclareTransactionTrace = typeof DeclareTransactionTrace.Type;
|
|
744
|
+
|
|
745
|
+
/** Trace for deploy account transactions.
|
|
746
|
+
*
|
|
747
|
+
* @prop validateInvocation The __validate__ call.
|
|
748
|
+
* @prop constructorInvocation The __constructor__ call.
|
|
749
|
+
* @prop feeTransferInvocation The __fee_transfer__ call.
|
|
750
|
+
*/
|
|
751
|
+
export const DeployAccountTransactionTrace = Schema.Struct({
|
|
752
|
+
_tag: tag("deployAccount"),
|
|
753
|
+
deployAccount: Schema.Struct({
|
|
754
|
+
validateInvocation: Schema.optional(FunctionInvocation),
|
|
755
|
+
constructorInvocation: Schema.optional(FunctionInvocation),
|
|
756
|
+
feeTransferInvocation: Schema.optional(FunctionInvocation),
|
|
757
|
+
}),
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
export type DeployAccountTransactionTrace =
|
|
761
|
+
typeof DeployAccountTransactionTrace.Type;
|
|
762
|
+
|
|
763
|
+
/** Trace for L1 handler transactions.
|
|
764
|
+
*
|
|
765
|
+
* @prop functionInvocation The L1 handler function invocation.
|
|
766
|
+
*/
|
|
767
|
+
export const L1HandlerTransactionTrace = Schema.Struct({
|
|
768
|
+
_tag: tag("l1Handler"),
|
|
769
|
+
l1Handler: Schema.Struct({
|
|
770
|
+
functionInvocation: Schema.optional(FunctionInvocation),
|
|
771
|
+
}),
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
/** A transaction trace.
|
|
775
|
+
*
|
|
776
|
+
* @prop transactionHash The hash of the trace's transaction.
|
|
777
|
+
* @prp traceRoot the trace root entry.
|
|
778
|
+
*/
|
|
779
|
+
export const TransactionTrace = Schema.Struct({
|
|
780
|
+
filterIds: Schema.Array(Schema.Number),
|
|
781
|
+
transactionIndex: Schema.Number,
|
|
782
|
+
transactionHash: FieldElement,
|
|
783
|
+
traceRoot: Schema.Union(
|
|
784
|
+
InvokeTransactionTrace,
|
|
785
|
+
DeclareTransactionTrace,
|
|
786
|
+
DeployAccountTransactionTrace,
|
|
787
|
+
L1HandlerTransactionTrace,
|
|
788
|
+
),
|
|
789
|
+
});
|
|
790
|
+
|
|
791
|
+
export type TransactionTrace = typeof TransactionTrace.Type;
|
|
792
|
+
|
|
575
793
|
/** A block.
|
|
576
794
|
*
|
|
577
795
|
* @prop header The block header.
|
|
@@ -579,6 +797,7 @@ export type NonceUpdate = typeof NonceUpdate.Type;
|
|
|
579
797
|
* @prop receipts The receipts of the transactions.
|
|
580
798
|
* @prop events The events emitted by the transactions.
|
|
581
799
|
* @prop messages The messages sent to L1 by the transactions.
|
|
800
|
+
* @prop traces The transaction traces.
|
|
582
801
|
* @prop storageDiffs The changes to the storage.
|
|
583
802
|
* @prop contractChanges The changes to contracts and classes.
|
|
584
803
|
*/
|
|
@@ -588,6 +807,7 @@ export const Block = Schema.Struct({
|
|
|
588
807
|
receipts: Schema.Array(TransactionReceipt),
|
|
589
808
|
events: Schema.Array(Event),
|
|
590
809
|
messages: Schema.Array(MessageToL1),
|
|
810
|
+
traces: Schema.Array(TransactionTrace),
|
|
591
811
|
storageDiffs: Schema.Array(StorageDiff),
|
|
592
812
|
contractChanges: Schema.Array(ContractChange),
|
|
593
813
|
nonceUpdates: Schema.Array(NonceUpdate),
|
package/src/filter.ts
CHANGED
|
@@ -106,6 +106,7 @@ export type TransactionStatusFilter = typeof TransactionStatusFilter.Type;
|
|
|
106
106
|
* @prop includeReceipt Include the transaction receipt.
|
|
107
107
|
* @prop includeMessages Include the messages that were sent to L1 in the same transaction.
|
|
108
108
|
* @prop includeSiblings Include the sibling events of the matched events.
|
|
109
|
+
* @prop includeTransactionTrace Include the trace of the transaction that emitted the event.
|
|
109
110
|
*/
|
|
110
111
|
export const EventFilter = Schema.Struct({
|
|
111
112
|
id: Schema.optional(Schema.Number),
|
|
@@ -117,6 +118,7 @@ export const EventFilter = Schema.Struct({
|
|
|
117
118
|
includeReceipt: Schema.optional(Schema.Boolean),
|
|
118
119
|
includeMessages: Schema.optional(Schema.Boolean),
|
|
119
120
|
includeSiblings: Schema.optional(Schema.Boolean),
|
|
121
|
+
includeTransactionTrace: Schema.optional(Schema.Boolean),
|
|
120
122
|
});
|
|
121
123
|
|
|
122
124
|
export type EventFilter = typeof EventFilter.Type;
|
|
@@ -129,6 +131,7 @@ export type EventFilter = typeof EventFilter.Type;
|
|
|
129
131
|
* @prop includeTransaction Include the transaction that sent the message.
|
|
130
132
|
* @prop includeReceipt Include the transaction receipt.
|
|
131
133
|
* @prop includeEvents Include events from the same transaction.
|
|
134
|
+
* @prop includeTransactionTrace Include the trace of the transaction that sent the message.
|
|
132
135
|
*/
|
|
133
136
|
export const MessageToL1Filter = Schema.Struct({
|
|
134
137
|
id: Schema.optional(Schema.Number),
|
|
@@ -138,6 +141,7 @@ export const MessageToL1Filter = Schema.Struct({
|
|
|
138
141
|
includeTransaction: Schema.optional(Schema.Boolean),
|
|
139
142
|
includeReceipt: Schema.optional(Schema.Boolean),
|
|
140
143
|
includeEvents: Schema.optional(Schema.Boolean),
|
|
144
|
+
includeTransactionTrace: Schema.optional(Schema.Boolean),
|
|
141
145
|
});
|
|
142
146
|
|
|
143
147
|
export type MessageToL1Filter = typeof MessageToL1Filter.Type;
|
|
@@ -147,62 +151,87 @@ export const InvokeTransactionV0Filter = Schema.Struct({
|
|
|
147
151
|
invokeV0: Schema.Struct({}),
|
|
148
152
|
});
|
|
149
153
|
|
|
154
|
+
export type InvokeTransactionV0Filter = typeof InvokeTransactionV0Filter.Type;
|
|
155
|
+
|
|
150
156
|
export const InvokeTransactionV1Filter = Schema.Struct({
|
|
151
157
|
_tag: tag("invokeV1"),
|
|
152
158
|
invokeV1: Schema.Struct({}),
|
|
153
159
|
});
|
|
154
160
|
|
|
161
|
+
export type InvokeTransactionV1Filter = typeof InvokeTransactionV1Filter.Type;
|
|
162
|
+
|
|
155
163
|
export const InvokeTransactionV3Filter = Schema.Struct({
|
|
156
164
|
_tag: tag("invokeV3"),
|
|
157
165
|
invokeV3: Schema.Struct({}),
|
|
158
166
|
});
|
|
159
167
|
|
|
168
|
+
export type InvokeTransactionV3Filter = typeof InvokeTransactionV3Filter.Type;
|
|
169
|
+
|
|
160
170
|
export const DeployTransactionFilter = Schema.Struct({
|
|
161
171
|
_tag: tag("deploy"),
|
|
162
172
|
deploy: Schema.Struct({}),
|
|
163
173
|
});
|
|
164
174
|
|
|
175
|
+
export type DeployTransactionFilter = typeof DeployTransactionFilter.Type;
|
|
176
|
+
|
|
165
177
|
export const DeclareV0TransactionFilter = Schema.Struct({
|
|
166
178
|
_tag: tag("declareV0"),
|
|
167
179
|
declareV0: Schema.Struct({}),
|
|
168
180
|
});
|
|
169
181
|
|
|
182
|
+
export type DeclareV0TransactionFilter = typeof DeclareV0TransactionFilter.Type;
|
|
183
|
+
|
|
170
184
|
export const DeclareV1TransactionFilter = Schema.Struct({
|
|
171
185
|
_tag: tag("declareV1"),
|
|
172
186
|
declareV1: Schema.Struct({}),
|
|
173
187
|
});
|
|
174
188
|
|
|
189
|
+
export type DeclareV1TransactionFilter = typeof DeclareV1TransactionFilter.Type;
|
|
190
|
+
|
|
175
191
|
export const DeclareV2TransactionFilter = Schema.Struct({
|
|
176
192
|
_tag: tag("declareV2"),
|
|
177
193
|
declareV2: Schema.Struct({}),
|
|
178
194
|
});
|
|
179
195
|
|
|
196
|
+
export type DeclareV2TransactionFilter = typeof DeclareV2TransactionFilter.Type;
|
|
197
|
+
|
|
180
198
|
export const DeclareV3TransactionFilter = Schema.Struct({
|
|
181
199
|
_tag: tag("declareV3"),
|
|
182
200
|
declareV3: Schema.Struct({}),
|
|
183
201
|
});
|
|
184
202
|
|
|
203
|
+
export type DeclareV3TransactionFilter = typeof DeclareV3TransactionFilter.Type;
|
|
204
|
+
|
|
185
205
|
export const L1HandlerTransactionFilter = Schema.Struct({
|
|
186
206
|
_tag: tag("l1Handler"),
|
|
187
207
|
l1Handler: Schema.Struct({}),
|
|
188
208
|
});
|
|
189
209
|
|
|
210
|
+
export type L1HandlerTransactionFilter = typeof L1HandlerTransactionFilter.Type;
|
|
211
|
+
|
|
190
212
|
export const DeployAccountV1TransactionFilter = Schema.Struct({
|
|
191
213
|
_tag: tag("deployAccountV1"),
|
|
192
214
|
deployAccountV1: Schema.Struct({}),
|
|
193
215
|
});
|
|
194
216
|
|
|
217
|
+
export type DeployAccountV1TransactionFilter =
|
|
218
|
+
typeof DeployAccountV1TransactionFilter.Type;
|
|
219
|
+
|
|
195
220
|
export const DeployAccountV3TransactionFilter = Schema.Struct({
|
|
196
221
|
_tag: tag("deployAccountV3"),
|
|
197
222
|
deployAccountV3: Schema.Struct({}),
|
|
198
223
|
});
|
|
199
224
|
|
|
225
|
+
export type DeployAccountV3TransactionFilter =
|
|
226
|
+
typeof DeployAccountV3TransactionFilter.Type;
|
|
227
|
+
|
|
200
228
|
/** Filter transactions.
|
|
201
229
|
*
|
|
202
230
|
* @prop transactionStatus Filter based on the transaction status.
|
|
203
231
|
* @prop includeReceipt Include the transaction receipt.
|
|
204
232
|
* @prop includeEvents Include events from the same transaction.
|
|
205
233
|
* @prop includeMessages Include messages sent in the transaction.
|
|
234
|
+
* @prop includeTrace Include the transaction's trace.
|
|
206
235
|
*/
|
|
207
236
|
export const TransactionFilter = Schema.Struct({
|
|
208
237
|
id: Schema.optional(Schema.Number),
|
|
@@ -210,6 +239,7 @@ export const TransactionFilter = Schema.Struct({
|
|
|
210
239
|
includeReceipt: Schema.optional(Schema.Boolean),
|
|
211
240
|
includeMessages: Schema.optional(Schema.Boolean),
|
|
212
241
|
includeEvents: Schema.optional(Schema.Boolean),
|
|
242
|
+
includeTrace: Schema.optional(Schema.Boolean),
|
|
213
243
|
transactionType: Schema.optional(
|
|
214
244
|
Schema.Union(
|
|
215
245
|
InvokeTransactionV0Filter,
|
|
@@ -275,6 +305,8 @@ export const ContractChangeFilter = Schema.Struct({
|
|
|
275
305
|
),
|
|
276
306
|
});
|
|
277
307
|
|
|
308
|
+
export type ContractChangeFilter = typeof ContractChangeFilter.Type;
|
|
309
|
+
|
|
278
310
|
/** Filter updates to nonces.
|
|
279
311
|
*
|
|
280
312
|
* @prop contractAddress Filter by contract address.
|
|
@@ -284,6 +316,8 @@ export const NonceUpdateFilter = Schema.Struct({
|
|
|
284
316
|
contractAddress: Schema.optional(FieldElement),
|
|
285
317
|
});
|
|
286
318
|
|
|
319
|
+
export type NonceUpdateFilter = typeof NonceUpdateFilter.Type;
|
|
320
|
+
|
|
287
321
|
export const Filter = Schema.Struct({
|
|
288
322
|
header: Schema.optional(HeaderFilter),
|
|
289
323
|
transactions: Schema.optional(Schema.Array(TransactionFilter)),
|