ethers.js/lib.commonjs/providers/subscriber-polling.d.ts

94 lines
2.9 KiB
TypeScript
Raw Permalink Normal View History

2023-03-03 18:25:07 -07:00
import type { AbstractProvider, Subscriber } from "./abstract-provider.js";
import type { EventFilter, OrphanFilter, ProviderEvent } from "./provider.js";
/**
2023-06-01 17:52:58 -04:00
* Return the polling subscriber for common events.
2023-03-03 18:25:07 -07:00
*
* @_docloc: api/providers/abstract-provider
*/
export declare function getPollingSubscriber(provider: AbstractProvider, event: ProviderEvent): Subscriber;
/**
2023-06-01 17:52:58 -04:00
* A **PollingBlockSubscriber** polls at a regular interval for a change
* in the block number.
2023-03-03 18:25:07 -07:00
*
* @_docloc: api/providers/abstract-provider
*/
export declare class PollingBlockSubscriber implements Subscriber {
#private;
2023-06-01 17:52:58 -04:00
/**
* Create a new **PollingBlockSubscriber** attached to %%provider%%.
*/
2023-03-03 18:25:07 -07:00
constructor(provider: AbstractProvider);
2023-06-01 17:52:58 -04:00
/**
* The polling interval.
*/
2023-03-03 18:25:07 -07:00
get pollingInterval(): number;
set pollingInterval(value: number);
start(): void;
stop(): void;
pause(dropWhilePaused?: boolean): void;
resume(): void;
}
/**
2023-06-01 17:52:58 -04:00
* An **OnBlockSubscriber** can be sub-classed, with a [[_poll]]
* implmentation which will be called on every new block.
2023-03-03 18:25:07 -07:00
*
* @_docloc: api/providers/abstract-provider
*/
export declare class OnBlockSubscriber implements Subscriber {
#private;
2023-06-01 17:52:58 -04:00
/**
* Create a new **OnBlockSubscriber** attached to %%provider%%.
*/
2023-03-03 18:25:07 -07:00
constructor(provider: AbstractProvider);
2023-06-01 17:52:58 -04:00
/**
* Called on every new block.
*/
2023-03-03 18:25:07 -07:00
_poll(blockNumber: number, provider: AbstractProvider): Promise<void>;
start(): void;
stop(): void;
pause(dropWhilePaused?: boolean): void;
resume(): void;
}
/**
2023-06-01 17:52:58 -04:00
* @_ignore:
2023-03-03 18:25:07 -07:00
*
* @_docloc: api/providers/abstract-provider
*/
export declare class PollingOrphanSubscriber extends OnBlockSubscriber {
#private;
constructor(provider: AbstractProvider, filter: OrphanFilter);
_poll(blockNumber: number, provider: AbstractProvider): Promise<void>;
}
/**
2023-06-01 17:52:58 -04:00
* A **PollingTransactionSubscriber** will poll for a given transaction
* hash for its receipt.
2023-03-03 18:25:07 -07:00
*
* @_docloc: api/providers/abstract-provider
*/
export declare class PollingTransactionSubscriber extends OnBlockSubscriber {
#private;
2023-06-01 17:52:58 -04:00
/**
* Create a new **PollingTransactionSubscriber** attached to
* %%provider%%, listening for %%hash%%.
*/
2023-03-03 18:25:07 -07:00
constructor(provider: AbstractProvider, hash: string);
_poll(blockNumber: number, provider: AbstractProvider): Promise<void>;
}
/**
2023-06-01 17:52:58 -04:00
* A **PollingEventSubscriber** will poll for a given filter for its logs.
2023-03-03 18:25:07 -07:00
*
* @_docloc: api/providers/abstract-provider
*/
export declare class PollingEventSubscriber implements Subscriber {
#private;
2023-06-01 17:52:58 -04:00
/**
* Create a new **PollingTransactionSubscriber** attached to
* %%provider%%, listening for %%filter%%.
*/
2023-03-03 18:25:07 -07:00
constructor(provider: AbstractProvider, filter: EventFilter);
start(): void;
stop(): void;
pause(dropWhilePaused?: boolean): void;
resume(): void;
}
//# sourceMappingURL=subscriber-polling.d.ts.map