The available providers should suffice for most developers purposes, but the AbstractProvider class has many features which enable sub-classing it for specific purposes.
Options for configuring some internal aspects of an AbstractProvider.
cacheTimeout - how long to cache a low-level _perform for, based on input parameters. This reduces the number of calls to getChainId and getBlockNumber, but may break test chains which can perform operations (internally) synchronously. Use -1 to disable, 0 will only buffer within the same event loop and any other value is in ms. (default: 250)
A normalized filter used for PerformActionRequest objects.
The AbstractProvider methods will normalize all values and pass this type to abstractProvider._perform.
The value passed to the abstractProvider._getSubscriber method.
Only developers sub-classing [[AbstractProvider[[ will care about this, if they are modifying a low-level feature of how subscriptions operate.
An AbstractProvider provides a base class for other sub-classes to implement the Provider API by normalizing input arguments and formatting output results as well as tracking events for consistent behaviour on an eventually-consistent network.
If this provider has been destroyed using the destroy method.
Once destroyed, all resources are reclaimed, internal event loops and timers are cleaned up and no further requests may be sent to the provider.
Prevent any CCIP-read operation, regardless of whether requested in a call using enableCcipRead.
Whether the provider is currently paused.
A paused provider will not emit any events, and generally should not make any requests to the network, but that is up to sub-classes to manage.
Setting paused = true is identical to calling .pause(false), which will buffer any events that occur while paused until the provider is unpaused.
Returns this, to allow an AbstractProvider to implement the ContractRunner interface.
Create a new AbstractProvider connected to network, or use the various network detection capabilities to discover the Network if necessary.
Clear a timer created using the _setTimeout method.
Returns or resolves to the address for address, resolving ENS names and Addressable objects and returning if already an address.
Returns or resolves to a filter for filter, resolving any ENS names or Addressable object and returning if already a valid filter.
Returns or resolves to a transaction for request, resolving any ENS names or Addressable and returning if already a valid transaction.
If a Subscriber fails and needs to replace itself, this method may be used.
For example, this is used for providers when using the eth_getFilterChanges method, which can return null if state filters are not supported by the backend, allowing the Subscriber to swap in a PollingEventSubscriber.
Create a timer that will execute func after at least timeout (in ms). If timeout is unspecified, then func will execute in the next event loop.
Pausing the provider will pause any associated timers.
Provides the opportunity for a sub-class to wrap a block before returning it, to add additional properties or an alternate sub-class of Block.
Provides the opportunity for a sub-class to wrap a log before returning it, to add additional properties or an alternate sub-class of Log.
Provides the opportunity for a sub-class to wrap a transaction receipt before returning it, to add additional properties or an alternate sub-class of TransactionReceipt.
Provides the opportunity for a sub-class to wrap a transaction response before returning it, to add additional properties or an alternate sub-class of TransactionResponse.
An AbstractPlugin is used to provide additional internal services to an AbstractProvider without adding backwards-incompatible changes to method signatures or other internal and complex logic.
Creates a new FilterIdSubscriber which will used _subscribe and _emitResults to setup the subscription and provide the event to the provider.
An OnBlockSubscriber can be sub-classed, with a _poll implmentation which will be called on every new block.
A normalized transactions used for PerformActionRequest objects.
Called when the subscription should pause.
If dropWhilePaused, events that occur while paused should not be emitted resume.
A SocketSubscriber uses a socket transport to handle events and should use _emit to manage the events.