Web3RequestManager <API>
Hierarchy
- Web3EventEmitter<{ [ key in Web3RequestManagerEvent ]: SupportedProviders<API> | undefined }>
- Web3RequestManager
Index
Constructors
publicconstructor
Type parameters
- API: unknown = EthExecutionAPI
Parameters
optionalprovider: string | SupportedProviders<API>
optionaluseRpcCallSpecification: boolean
optionalrequestManagerMiddleware: RequestManagerMiddleware<API>
Returns Web3RequestManager<API>
Properties
publicoptionalmiddleware
Accessors
publicprovider
Returns undefined | SupportedProviders<API>
Returns the current provider
publicproviders
Will return all available providers
Returns { HttpProvider: Web3BaseProviderConstructor; WebsocketProvider: Web3BaseProviderConstructor }
HttpProvider: Web3BaseProviderConstructor
WebsocketProvider: Web3BaseProviderConstructor
publicstaticproviders
Will return all available providers
Returns { HttpProvider: Web3BaseProviderConstructor; WebsocketProvider: Web3BaseProviderConstructor }
HttpProvider: Web3BaseProviderConstructor
WebsocketProvider: Web3BaseProviderConstructor
Methods
publicemit
Type parameters
- K: Web3EventKey<{ BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }>
Parameters
eventName: K
params: { BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }[K]
Returns void
publiceventNames
Returns (string | symbol)[]
publicgetMaxListeners
Returns number
publiclistenerCount
Type parameters
- K: Web3EventKey<{ BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }>
Parameters
eventName: K
Returns number
publiclisteners
Type parameters
- K: Web3EventKey<{ BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }>
Parameters
eventName: K
Returns (...args: any[]) => void[]
publicoff
Type parameters
- K: Web3EventKey<{ BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }>
Parameters
eventName: K
fn: Web3EventCallback<{ BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }[K]>
Returns void
publicon
Type parameters
- K: Web3EventKey<{ BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }>
Parameters
eventName: K
fn: Web3EventCallback<{ BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }[K]>
Returns void
publiconce
Type parameters
- K: Web3EventKey<{ BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }>
Parameters
eventName: K
fn: Web3EventCallback<{ BEFORE_PROVIDER_CHANGE: undefined | SupportedProviders<API>; PROVIDER_CHANGED: undefined | SupportedProviders<API> }[K]>
Returns void
publicremoveAllListeners
Returns EventEmitter
publicsend
Will execute a request
Type parameters
- Method: string
- ResponseType = Web3APIReturnType<API, Method>
Parameters
request: Web3APIRequest<API, Method>
Web3APIRequest The request to send
Returns Promise<ResponseType>
The response of the request ResponseType. If there is error in the response, will throw an error
publicsendBatch
Same as send, but, will execute a batch of requests
Parameters
request: JsonRpcBatchRequest
JsonRpcBatchRequest The batch request to send
Returns Promise<JsonRpcBatchResponse<unknown, JsonRpcResult>>
publicsetMaxListenerWarningThreshold
Parameters
maxListenersWarningThreshold: number
Returns void
publicsetMiddleware
Parameters
requestManagerMiddleware: RequestManagerMiddleware<API>
Returns void
publicsetProvider
Use to set provider. Provider can be a provider instance or a string.
Parameters
optionalprovider: string | SupportedProviders<API>
The provider to set
Returns boolean
Will return the current provider.