LogsSubscription
Hierarchy
- Web3Subscription<CommonSubscriptionEvents & { data: LogsOutput }, { address?: Address | Address[]; fromBlock?: BlockNumberOrTag; topics?: Topic[] }>
- LogsSubscription
Index
Constructors
constructor
Parameters
args: { address?: string | string[]; fromBlock?: BlockNumberOrTag; topics?: string[] }
options: { requestManager: Web3RequestManager<EthExecutionAPI>; returnFormat?: DataFormat }
Returns LogsSubscription
Properties
readonlyargs
Type declaration
optionalreadonlyaddress?: string | string[]
optionalreadonlyfromBlock?: BlockNumberOrTag
optionalreadonlytopics?: string[]
Accessors
id
Returns undefined | string
lastBlock
Returns undefined | BlockOutput
Methods
public_processSubscriptionError
Parameters
error: Error
Returns void
public_processSubscriptionResult
Parameters
data: LogsOutput
Returns void
emit
Type parameters
- K: Web3EventKey<CommonSubscriptionEvents & { data: LogsOutput }>
Parameters
eventName: K
params: CommonSubscriptionEvents & { data: LogsOutput }[K]
Returns void
eventNames
Returns (string | symbol)[]
getMaxListeners
Returns number
listenerCount
Type parameters
- K: Web3EventKey<CommonSubscriptionEvents & { data: LogsOutput }>
Parameters
eventName: K
Returns number
listeners
Type parameters
- K: Web3EventKey<CommonSubscriptionEvents & { data: LogsOutput }>
Parameters
eventName: K
Returns Function[]
off
Type parameters
- K: Web3EventKey<CommonSubscriptionEvents & { data: LogsOutput }>
Parameters
eventName: K
fn: Web3EventCallback<CommonSubscriptionEvents & { data: LogsOutput }[K]>
Returns void
on
Type parameters
- K: Web3EventKey<CommonSubscriptionEvents & { data: LogsOutput }>
Parameters
eventName: K
fn: Web3EventCallback<CommonSubscriptionEvents & { data: LogsOutput }[K]>
Returns void
once
Type parameters
- K: Web3EventKey<CommonSubscriptionEvents & { data: LogsOutput }>
Parameters
eventName: K
fn: Web3EventCallback<CommonSubscriptionEvents & { data: LogsOutput }[K]>
Returns void
removeAllListeners
Returns EventEmitter
resubscribe
Returns Promise<void>
setMaxListenerWarningThreshold
Parameters
maxListenersWarningThreshold: number
Returns void
subscribe
Returns Promise<void>
unsubscribe
Returns Promise<void>
subscribe(“logs”)
Subscribes to incoming logs, filtered by the given options. If a valid numerical fromBlock options property is set, web3.js will retrieve logs beginning from this point, backfilling the response as necessary.
You can subscribe to logs matching a given filter object, which can take the following parameters:
fromBlock
: (optional, default: “latest”) Integer block number, or “latest” for the last mined block or “pending”, “earliest” for not yet mined transactions.address
: (optional) Contract address or a list of addresses from which logs should originate.topics
: (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with “or” options.