-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.d.ts
More file actions
932 lines (876 loc) · 28.6 KB
/
index.d.ts
File metadata and controls
932 lines (876 loc) · 28.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
/* auto-generated by NAPI-RS */
/* eslint-disable */
/** Decoder for Ethereum function calls */
export declare class CallDecoder {
/** Create call decoder from function signatures */
static fromSignatures(signatures: Array<string>): CallDecoder
/** Create call decoder from function signatures with checksum option */
static fromSignaturesWithChecksum(signatures: Array<string>, checksum: boolean): CallDecoder
/** Decode function call inputs asynchronously */
decodeInputs(inputs: Array<string>): Promise<Array<Array<DecodedSolValue> | undefined | null>>
/** Decode transaction inputs asynchronously */
decodeTransactionsInput(txs: Array<Transaction>): Promise<Array<Array<DecodedSolValue> | undefined | null>>
/** Decode trace inputs asynchronously */
decodeTracesInput(traces: Array<Trace>): Promise<Array<Array<DecodedSolValue> | undefined | null>>
/** Decode function call inputs synchronously */
decodeInputsSync(inputs: Array<string>): Array<Array<DecodedSolValue> | undefined | null>
/** Decode transaction inputs synchronously */
decodeTransactionsInputSync(txs: Array<Transaction>): Array<Array<DecodedSolValue> | undefined | null>
/** Decode trace inputs synchronously */
decodeTracesInputSync(traces: Array<Trace>): Array<Array<DecodedSolValue> | undefined | null>
/** Decode a single input string */
decodeImpl(input: string): Array<DecodedSolValue> | null
}
/** Decoder for Ethereum events and function calls */
export declare class Decoder {
/** Create decoder from event signatures */
static fromSignatures(signatures: Array<string>): Decoder
/** Create decoder from event signatures with checksum option */
static fromSignaturesWithChecksum(signatures: Array<string>, checksum: boolean): Decoder
/** Enable checksummed addresses in decoded output */
enableChecksummedAddresses(): void
/** Disable checksummed addresses in decoded output */
disableChecksummedAddresses(): void
/** Decode logs asynchronously */
decodeLogs(logs: Array<Log>): Promise<Array<DecodedEvent | undefined | null>>
/** Decode logs synchronously */
decodeLogsSync(logs: Array<Log>): Array<DecodedEvent | undefined | null>
/** Decode events asynchronously */
decodeEvents(events: Array<Event>): Promise<Array<DecodedEvent | undefined | null>>
/** Decode events synchronously */
decodeEventsSync(events: Array<Event>): Array<DecodedEvent | undefined | null>
}
/** Stream for receiving event responses */
export declare class EventStream {
/** Close the event stream */
close(): Promise<void>
/** Receive the next event response from the stream */
recv(): Promise<EventResponse | null>
}
/**
* Stream for receiving height stream events
* yields the immediate height of the chain and then
* continues to yield height updates as they are received
*/
export declare class HeightStream {
/** Close the height stream */
close(): Promise<void>
/** Receive the next height stream event from the stream */
recv(): Promise<HeightStreamEvent | null>
}
/** HyperSync client for querying blockchain data */
export declare class HypersyncClient {
/** Create a new client with given config */
constructor(cfg: ClientConfig)
/**
* Create a new client with custom user agent
*
* This method is intended for internal use when you need to customize the user agent string.
* Most users should use `new()` instead.
*
* @internal
*/
static newWithAgent(cfg: ClientConfig, userAgent: string): HypersyncClient
/** Get the height of the source hypersync instance */
getHeight(): Promise<number>
/** Get the chain_id of the source hypersync instance */
getChainId(): Promise<number>
/** Collect blockchain data from the given query */
collect(query: Query, config: StreamConfig): Promise<QueryResponse>
/** Collect blockchain events from the given query */
collectEvents(query: Query, config: StreamConfig): Promise<EventResponse>
/** Collect blockchain data and save to parquet format */
collectParquet(path: string, query: Query, config: StreamConfig): Promise<void>
/** Get blockchain data for a single query */
get(query: Query): Promise<QueryResponse>
/** Get blockchain events for a single query */
getEvents(query: Query): Promise<EventResponse>
/** Stream chain height events */
streamHeight(): Promise<HeightStream>
/** Stream blockchain data from the given query */
stream(query: Query, config: StreamConfig): Promise<QueryResponseStream>
/** Get blockchain data for a single query, with rate limit info */
getWithRateLimit(query: Query): Promise<QueryResponseWithRateLimit>
/**
* Get the most recently observed rate limit information.
* Returns null if no requests have been made yet.
*/
rateLimitInfo(): RateLimitInfo | null
/**
* Wait until the current rate limit window resets.
* Returns immediately if no rate limit info observed or quota available.
*/
waitForRateLimit(): Promise<void>
/** Stream blockchain events from the given query */
streamEvents(query: Query, config: StreamConfig): Promise<EventStream>
}
/** Stream for receiving query responses */
export declare class QueryResponseStream {
/** Close the response stream */
close(): Promise<void>
/** Receive the next query response from the stream */
recv(): Promise<QueryResponse | null>
}
/**
* Evm access list object
*
* See ethereum rpc spec for the meaning of fields
*/
export interface AccessList {
address?: string
storageKeys?: Array<string>
}
/**
* Evm authorization object
*
* See ethereum rpc spec for the meaning of fields
*/
export interface Authorization {
/** uint256 */
chainId: bigint
/** 20-byte hex */
address: string
/** uint64 */
nonce: number
/** 0 | 1 */
yParity: number
/** 32-byte hex */
r: string
/** 32-byte hex */
s: string
}
/** Selection criteria for transaction authorization lists */
export interface AuthorizationSelection {
/** List of chain ids to match in the transaction authorizationList */
chainId?: Array<number>
/** List of addresses to match in the transaction authorizationList */
address?: Array<string>
}
/**
* Evm block header object
*
* See ethereum rpc spec for the meaning of fields
*/
export interface Block {
number?: number
hash?: string
parentHash?: string
nonce?: bigint
sha3Uncles?: string
logsBloom?: string
transactionsRoot?: string
stateRoot?: string
receiptsRoot?: string
miner?: string
difficulty?: bigint
totalDifficulty?: bigint
extraData?: string
size?: bigint
gasLimit?: bigint
gasUsed?: bigint
timestamp?: number
uncles?: Array<string>
baseFeePerGas?: bigint
blobGasUsed?: bigint
excessBlobGas?: bigint
parentBeaconBlockRoot?: string
withdrawalsRoot?: string
withdrawals?: Array<Withdrawal>
l1BlockNumber?: number
sendCount?: string
sendRoot?: string
mixHash?: string
}
/** Available fields for block data */
export type BlockField = 'Number'|
'Hash'|
'ParentHash'|
'Nonce'|
'Sha3Uncles'|
'LogsBloom'|
'TransactionsRoot'|
'StateRoot'|
'ReceiptsRoot'|
'Miner'|
'Difficulty'|
'TotalDifficulty'|
'ExtraData'|
'Size'|
'GasLimit'|
'GasUsed'|
'Timestamp'|
'Uncles'|
'BaseFeePerGas'|
'BlobGasUsed'|
'ExcessBlobGas'|
'ParentBeaconBlockRoot'|
'WithdrawalsRoot'|
'Withdrawals'|
'L1BlockNumber'|
'SendCount'|
'SendRoot'|
'MixHash';
/** Filter for selecting blocks based on hash and miner */
export interface BlockFilter {
/**
* Hash of a block, any blocks that have one of these hashes will be returned.
* Empty means match all.
*/
hash?: Array<string>
/**
* Miner address of a block, any blocks that have one of these miners will be returned.
* Empty means match all.
*/
miner?: Array<string>
}
/** Selection criteria for blocks with include and exclude filters */
export interface BlockSelection {
/** Blocks that match this filter will be included */
include: BlockFilter
/** Blocks that match this filter will be excluded */
exclude?: BlockFilter
}
/** Configuration for the hypersync client. */
export interface ClientConfig {
/** HyperSync server URL. */
url: string
/** HyperSync server api token. */
apiToken: string
/** Milliseconds to wait for a response before timing out. Default: 30000. */
httpReqTimeoutMillis?: number
/** Number of retries to attempt before returning error. Default: 12. */
maxNumRetries?: number
/** Milliseconds that would be used for retry backoff increasing. Default: 500. */
retryBackoffMs?: number
/** Initial wait time for request backoff. Default: 200. */
retryBaseMs?: number
/** Ceiling time for request backoff. Default: 5000. */
retryCeilingMs?: number
/** Enable checksum addresses in responses. */
enableChecksumAddresses?: boolean
/** Query serialization format to use for HTTP requests. Default: Json. */
serializationFormat?: SerializationFormat
/** Whether to use query caching when using CapnProto serialization format. */
enableQueryCaching?: boolean
/**
* Whether to proactively sleep when the rate limit is exhausted instead of
* sending requests that will be rejected with 429. Default: true.
*/
proactiveRateLimitSleep?: boolean
}
/**
* Column mapping for stream function output.
* It lets you map columns you want into the DataTypes you want.
*/
export interface ColumnMapping {
/** Mapping for block data. */
block?: Record<string, DataType>
/** Mapping for transaction data. */
transaction?: Record<string, DataType>
/** Mapping for log data. */
log?: Record<string, DataType>
/** Mapping for trace data. */
trace?: Record<string, DataType>
/** Mapping for decoded log data. */
decodedLog?: Record<string, DataType>
}
export type ConnectedTag = 'Connected';
/**
* DataType is an enumeration representing the different data types that can be used in the column mapping.
* Each variant corresponds to a specific data type.
*/
export type DataType = 'Float64'|
'Float32'|
'UInt64'|
'UInt32'|
'Int64'|
'Int32';
/** Decoded EVM log */
export interface DecodedEvent {
indexed: Array<DecodedSolValue>
body: Array<DecodedSolValue>
}
export interface DecodedSolValue {
val: boolean | bigint | string | Array<DecodedSolValue>
}
/** Data relating to a single event (log) */
export interface Event {
/** Transaction that triggered this event */
transaction?: Transaction
/** Block that this event happened in */
block?: Block
/** Evm log data */
log: Log
}
/** Response from an event query */
export interface EventResponse {
/** Current height of the source hypersync instance */
archiveHeight?: number
/**
* Next block to query for, the responses are paginated so,
* the caller should continue the query from this block if they
* didn't get responses up to the to_block they specified in the Query.
*/
nextBlock: number
/** Total time it took the hypersync instance to execute the query. */
totalExecutionTime: number
/** Response data */
data: Array<Event>
/** Rollback guard, supposed to be used to detect rollbacks */
rollbackGuard?: RollbackGuard
}
/** Collection of events from a blockchain query */
export interface Events {
/** Current height of the source hypersync instance */
archiveHeight?: number
/**
* Next block to query for, the responses are paginated so,
* the caller should continue the query from this block if they
* didn't get responses up to the to_block they specified in the Query.
*/
nextBlock: number
/** Total time it took the hypersync instance to execute the query. */
totalExecutionTime: number
/** Response data */
events: Array<Event>
/** Rollback guard, supposed to be used to detect rollbacks */
rollbackGuard?: RollbackGuard
}
/** Selection of specific fields to return for each data type */
export interface FieldSelection {
/** Block fields to include in the response */
block?: Array<BlockField>
/** Transaction fields to include in the response */
transaction?: Array<TransactionField>
/** Log fields to include in the response */
log?: Array<LogField>
/** Trace fields to include in the response */
trace?: Array<TraceField>
}
export interface HeightStreamConnectedEvent {
type: ConnectedTag
}
/**
* Height stream event, switch on 'event.type' to get different payload options
*
* switch (event.type) {
* case "Height":
* console.log("Height:", event.height);
* break;
* case "Connected":
* console.log("Connected to stream");
* break;
* case "Reconnecting":
* console.log("Reconnecting in", event.delayMillis, "ms", "due to error:", event.errorMsg);
* break;
* }
*/
export type HeightStreamEvent =
HeightStreamHeightEvent | HeightStreamConnectedEvent | HeightStreamReconnectingEvent
export interface HeightStreamHeightEvent {
type: HeightTag
height: number
}
export interface HeightStreamReconnectingEvent {
type: ReconnectingTag
delayMillis: number
errorMsg: string
}
export type HeightTag = 'Height';
/** Determines format of Binary column */
export type HexOutput = /** Binary column won't be formatted as hex */
'NoEncode'|
/** Binary column would be formatted as prefixed hex i.e. 0xdeadbeef */
'Prefixed'|
/** Binary column would be formatted as non prefixed hex i.e. deadbeef */
'NonPrefixed';
/** Mode for joining blockchain data */
export declare enum JoinMode {
/** Default join mode */
Default = 0,
/** Join all available data */
JoinAll = 1,
/** Join no additional data */
JoinNothing = 2
}
/**
* Evm log object
*
* See ethereum rpc spec for the meaning of fields
*/
export interface Log {
removed?: boolean
logIndex?: number
transactionIndex?: number
transactionHash?: string
blockHash?: string
blockNumber?: number
address?: string
data?: string
topics: Array<string | undefined | null>
}
/** Available fields for log data */
export type LogField = 'Removed'|
'LogIndex'|
'TransactionIndex'|
'TransactionHash'|
'BlockHash'|
'BlockNumber'|
'Address'|
'Data'|
'Topic0'|
'Topic1'|
'Topic2'|
'Topic3';
/** Filter for selecting logs based on address and topics */
export interface LogFilter {
/**
* Address of the contract, any logs that has any of these addresses will be returned.
* Empty means match all.
*/
address?: Array<string>
/**
* Topics to match, each member of the top level array is another array, if the nth topic matches any
* topic specified in topics[n] the log will be returned. Empty means match all.
*/
topics?: Array<Array<string>>
}
/** Selection criteria for logs with include and exclude filters */
export interface LogSelection {
/** Logs that match this filter will be included */
include: LogFilter
/** Logs that match this filter will be excluded */
exclude?: LogFilter
}
/**
* Returns a query object for all Blocks and hashes of the Transactions within the block range
* (from_block, to_block]. Also returns the block_hash and block_number fields on each Transaction
* so it can be mapped to a block. If to_block is None then query runs to the head of the chain.
*/
export declare function presetQueryBlocksAndTransactionHashes(fromBlock: number, toBlock?: number | undefined | null): Query
/**
* Returns a query for all Blocks and Transactions within the block range (from_block, to_block]
* If to_block is None then query runs to the head of the chain.
*/
export declare function presetQueryBlocksAndTransactions(fromBlock: number, toBlock?: number | undefined | null): Query
/**
* Returns a query object for all Logs within the block range from the given address.
* If to_block is None then query runs to the head of the chain.
*/
export declare function presetQueryLogs(contractAddress: string, fromBlock: number, toBlock?: number | undefined | null): Query
/**
* Returns a query for all Logs within the block range from the given address with a
* matching topic0 event signature. Topic0 is the keccak256 hash of the event signature.
* If to_block is None then query runs to the head of the chain.
*/
export declare function presetQueryLogsOfEvent(contractAddress: string, topic0: string, fromBlock: number, toBlock?: number | undefined | null): Query
/** Query for retrieving blockchain data */
export interface Query {
/** The block to start the query from */
fromBlock: number
/**
* The block to end the query at. If not specified, the query will go until the
* end of data. Exclusive, the returned range will be [from_block..to_block).
*
* The query will return before it reaches this target block if it hits the time limit
* configured on the server. The user should continue their query by putting the
* next_block field in the response into from_block field of their next query. This implements
* pagination.
*/
toBlock?: number
/**
* List of log selections, these have an or relationship between them, so the query will return logs
* that match any of these selections.
*/
logs?: Array<LogSelection | LogFilter>
/**
* List of transaction selections, the query will return transactions that match any of these selections and
* it will return transactions that are related to the returned logs.
*/
transactions?: Array<TransactionSelection | TransactionFilter>
/**
* List of trace selections, the query will return traces that match any of these selections and
* it will re turn traces that are related to the returned logs.
*/
traces?: Array<TraceSelection | TraceFilter>
/** List of block selections, the query will return blocks that match any of these selections */
blocks?: Array<BlockSelection | BlockFilter>
/**
* Weather to include all blocks regardless of if they are related to a returned transaction or log. Normally
* the server will return only the blocks that are related to the transaction or logs in the response. But if this
* is set to true, the server will return data for all blocks in the requested range [from_block, to_block).
*/
includeAllBlocks?: boolean
/**
* Field selection. The user can select which fields they are interested in, requesting less fields will improve
* query execution time and reduce the payload size so the user should always use a minimal number of fields.
*/
fieldSelection: FieldSelection
/**
* Maximum number of blocks that should be returned, the server might return more blocks than this number but
* it won't overshoot by too much.
*/
maxNumBlocks?: number
/**
* Maximum number of transactions that should be returned, the server might return more transactions than this number but
* it won't overshoot by too much.
*/
maxNumTransactions?: number
/**
* Maximum number of logs that should be returned, the server might return more logs than this number but
* it won't overshoot by too much.
*/
maxNumLogs?: number
/**
* Maximum number of traces that should be returned, the server might return more traces than this number but
* it won't overshoot by too much.
*/
maxNumTraces?: number
/**
* Selects join mode for the query,
* Default: join in this order logs -> transactions -> traces -> blocks
* JoinAll: join everything to everything. For example if logSelection matches log0, we get the
* associated transaction of log0 and then we get associated logs of that transaction as well. Applites similarly
* to blocks, traces.
* JoinNothing: join nothing.
*/
joinMode?: JoinMode
}
/** Response from a blockchain query */
export interface QueryResponse {
/** Current height of the source hypersync instance */
archiveHeight?: number
/**
* Next block to query for, the responses are paginated so,
* the caller should continue the query from this block if they
* didn't get responses up to the to_block they specified in the Query.
*/
nextBlock: number
/** Total time it took the hypersync instance to execute the query. */
totalExecutionTime: number
/** Response data */
data: QueryResponseData
/** Rollback guard, supposed to be used to detect rollbacks */
rollbackGuard?: RollbackGuard
}
/** Data returned from a query response */
export interface QueryResponseData {
/** Blocks returned by the query */
blocks: Array<Block>
/** Transactions returned by the query */
transactions: Array<Transaction>
/** Logs returned by the query */
logs: Array<Log>
/** Traces returned by the query */
traces: Array<Trace>
}
/** Response from a query that includes rate limit information. */
export interface QueryResponseWithRateLimit {
/** The query response data. */
response: QueryResponse
/** Rate limit information from response headers. */
rateLimit: RateLimitInfo
}
/** Rate limit information from server response headers. */
export interface RateLimitInfo {
/** Total request quota for the current window. */
limit?: number
/** Remaining budget in the current window. */
remaining?: number
/** Seconds until the rate limit window resets. */
resetSecs?: number
/** Budget consumed per request. */
cost?: number
}
export type ReconnectingTag = 'Reconnecting';
export interface RollbackGuard {
/** Block number of the last scanned block */
blockNumber: number
/** Block timestamp of the last scanned block */
timestamp: number
/** Block hash of the last scanned block */
hash: string
/**
* Block number of the first scanned block in memory.
*
* This might not be the first scanned block. It only includes blocks that are in memory (possible to be rolled back).
*/
firstBlockNumber: number
/**
* Parent hash of the first scanned block in memory.
*
* This might not be the first scanned block. It only includes blocks that are in memory (possible to be rolled back).
*/
firstParentHash: string
}
/** Determines query serialization format for HTTP requests. */
export type SerializationFormat = /** Use JSON serialization (default) */
'Json'|
/** Use Cap'n Proto binary serialization */
'CapnProto';
/**
* Set the log level for the underlying Rust logger.
*
* Accepts values like "info", "warn", "debug", "trace", "error",
* or a full filter directive like "hypersync_client=debug".
* If RUST_LOG env var is set, it takes precedence.
* Must be called before creating any HypersyncClient.
* Only the first call takes effect (logger can only init once per process).
*/
export declare function setLogLevel(level: string): void
/** Config for hypersync event streaming. */
export interface StreamConfig {
/**
* Column mapping for stream function output.
* It lets you map columns you want into the DataTypes you want.
*/
columnMapping?: ColumnMapping
/** Event signature used to populate decode logs. Decode logs would be empty if set to None. */
eventSignature?: string
/** Determines formatting of binary columns numbers into utf8 hex. Default: NoEncode. */
hexOutput?: HexOutput
/** Initial batch size. Size would be adjusted based on response size during execution. Default: 1000. */
batchSize?: number
/** Maximum batch size that could be used during dynamic adjustment. Default: 200000. */
maxBatchSize?: number
/** Minimum batch size that could be used during dynamic adjustment. Default: 200. */
minBatchSize?: number
/** Number of async threads that would be spawned to execute different block ranges of queries. Default: 10. */
concurrency?: number
/** Max number of blocks to fetch in a single request. */
maxNumBlocks?: number
/** Max number of transactions to fetch in a single request. */
maxNumTransactions?: number
/** Max number of logs to fetch in a single request. */
maxNumLogs?: number
/** Max number of traces to fetch in a single request. */
maxNumTraces?: number
/** Size of a response in bytes from which step size will be lowered. Default: 500000. */
responseBytesCeiling?: number
/** Size of a response in bytes from which step size will be increased. Default: 250000. */
responseBytesFloor?: number
/** Stream data in reverse order. Default: false. */
reverse?: boolean
}
/**
* Evm trace object
*
* See ethereum rpc spec for the meaning of fields
*/
export interface Trace {
from?: string
to?: string
callType?: string
gas?: bigint
input?: string
init?: string
value?: bigint
author?: string
rewardType?: string
blockHash?: string
blockNumber?: number
address?: string
code?: string
gasUsed?: bigint
output?: string
subtraces?: number
traceAddress?: Array<number>
transactionHash?: string
transactionPosition?: number
type?: string
error?: string
actionAddress?: string
balance?: bigint
refundAddress?: string
sighash?: string
}
/** Available fields for trace data */
export type TraceField = 'ActionAddress'|
'Balance'|
'RefundAddress'|
'Sighash'|
'From'|
'To'|
'CallType'|
'Gas'|
'Input'|
'Init'|
'Value'|
'Author'|
'RewardType'|
'BlockHash'|
'BlockNumber'|
'Address'|
'Code'|
'GasUsed'|
'Output'|
'Subtraces'|
'TraceAddress'|
'TransactionHash'|
'TransactionPosition'|
'Type'|
'Error';
/** Filter for selecting traces based on various criteria */
export interface TraceFilter {
from?: Array<string>
to?: Array<string>
address?: Array<string>
callType?: Array<string>
rewardType?: Array<string>
type?: Array<string>
sighash?: Array<string>
}
/** Selection criteria for traces with include and exclude filters */
export interface TraceSelection {
/** Traces that match this filter will be included */
include: TraceFilter
/** Traces that match this filter will be excluded */
exclude?: TraceFilter
}
/**
* Evm transaction object
*
* See ethereum rpc spec for the meaning of fields
*/
export interface Transaction {
blockHash?: string
blockNumber?: number
from?: string
gas?: bigint
gasPrice?: bigint
hash?: string
input?: string
nonce?: bigint
to?: string
transactionIndex?: number
value?: bigint
v?: string
r?: string
s?: string
yParity?: string
maxPriorityFeePerGas?: bigint
maxFeePerGas?: bigint
chainId?: number
accessList?: Array<AccessList>
authorizationList?: Array<Authorization>
maxFeePerBlobGas?: bigint
blobVersionedHashes?: Array<string>
cumulativeGasUsed?: bigint
effectiveGasPrice?: bigint
gasUsed?: bigint
contractAddress?: string
logsBloom?: string
type?: number
root?: string
status?: number
l1Fee?: bigint
l1GasPrice?: bigint
l1GasUsed?: bigint
l1FeeScalar?: number
gasUsedForL1?: bigint
blobGasPrice?: bigint
blobGasUsed?: bigint
depositNonce?: bigint
depositReceiptVersion?: bigint
l1BaseFeeScalar?: bigint
l1BlobBaseFee?: bigint
l1BlobBaseFeeScalar?: bigint
l1BlockNumber?: number
mint?: bigint
sighash?: string
sourceHash?: string
}
/** Available fields for transaction data */
export type TransactionField = 'BlockHash'|
'BlockNumber'|
'From'|
'Gas'|
'GasPrice'|
'Hash'|
'Input'|
'Nonce'|
'To'|
'TransactionIndex'|
'Value'|
'V'|
'R'|
'S'|
'YParity'|
'MaxPriorityFeePerGas'|
'MaxFeePerGas'|
'ChainId'|
'AccessList'|
'AuthorizationList'|
'MaxFeePerBlobGas'|
'BlobVersionedHashes'|
'CumulativeGasUsed'|
'EffectiveGasPrice'|
'GasUsed'|
'ContractAddress'|
'LogsBloom'|
'Type'|
'Root'|
'Status'|
'L1Fee'|
'L1BlockNumber'|
'L1GasPrice'|
'L1GasUsed'|
'L1FeeScalar'|
'L1BaseFeeScalar'|
'L1BlobBaseFee'|
'L1BlobBaseFeeScalar'|
'GasUsedForL1'|
'Sighash'|
'BlobGasPrice'|
'BlobGasUsed'|
'DepositNonce'|
'DepositReceiptVersion'|
'Mint'|
'SourceHash';
/** Filter for selecting transactions based on various criteria */
export interface TransactionFilter {
/**
* Address the transaction should originate from. If transaction.from matches any of these, the transaction
* will be returned. Keep in mind that this has an and relationship with to filter, so each transaction should
* match both of them. Empty means match all.
*/
from?: Array<string>
/**
* Address the transaction should go to. If transaction.to matches any of these, the transaction will
* be returned. Keep in mind that this has an and relationship with from filter, so each transaction should
* match both of them. Empty means match all.
*/
to?: Array<string>
/** If first 4 bytes of transaction input matches any of these, transaction will be returned. Empty means match all. */
sighash?: Array<string>
/** If tx.status matches this it will be returned. */
status?: number
/** If transaction.type matches any of these values, the transaction will be returned */
type?: Array<number>
contractAddress?: Array<string>
/**
* If transaction.hash matches any of these values, the transaction will be returned.
* Empty means match all.
*/
hash?: Array<string>
/** If transaction.authorization_list matches any of these values, the transaction will be returned. */
authorizationList?: Array<AuthorizationSelection>
}
/** Selection criteria for transactions with include and exclude filters */
export interface TransactionSelection {
/** Transactions that match this filter will be included */
include: TransactionFilter
/** Transactions that match this filter will be excluded */
exclude?: TransactionFilter
}
/**
* Evm withdrawal object
*
* See ethereum rpc spec for the meaning of fields
*/
export interface Withdrawal {
index?: string
validatorIndex?: string
address?: string
amount?: string
}