1 | import { Block, GetOptions, IterOptions } from '@neo-one/client-common';
|
2 | import { Monitor } from '@neo-one/monitor';
|
3 | interface Client {
|
4 | readonly getBlockCount: (monitor?: Monitor) => Promise<number>;
|
5 | readonly getBlock: (index: number, options?: GetOptions) => Promise<Block>;
|
6 | }
|
7 | interface AsyncBlockIteratorOptions {
|
8 | readonly client: Client;
|
9 | readonly options: IterOptions;
|
10 | readonly fetchTimeoutMS?: number;
|
11 | readonly batchSize?: number;
|
12 | }
|
13 | export declare class AsyncBlockIterator implements AsyncIterator<Block> {
|
14 | private readonly client;
|
15 | private readonly mutableItems;
|
16 | private mutableResolvers;
|
17 | private mutableDone;
|
18 | private mutableCurrentIndex;
|
19 | private mutableFetching;
|
20 | private mutableStartHeight;
|
21 | private readonly indexStop;
|
22 | private readonly fetchTimeoutMS;
|
23 | private readonly batchSize;
|
24 | private readonly monitor;
|
25 | constructor({ client, options: { indexStart, indexStop, monitor }, fetchTimeoutMS, batchSize, }: AsyncBlockIteratorOptions);
|
26 | [Symbol.asyncIterator](): this;
|
27 | next(): Promise<IteratorResult<Block>>;
|
28 | private write;
|
29 | private error;
|
30 | private push;
|
31 | private done;
|
32 | private fetch;
|
33 | private asyncFetch;
|
34 | private fetchOne;
|
35 | }
|
36 | export {};
|