Indexing Incoming Transaction
Last updated
Last updated
The @indexTransaction decorator can be used to mark an indexer method that will be listening for incoming transactions on a contract. Please note that if you are only interested in handling calls to specific entrypoints, @indexEntrypoint is better suited for the job.
When an incoming transaction is detected on an indexed contract, the method will be invoked with detailed information about the call.
The following parameters will be passed to the indexing method:
Name | Description |
---|---|
The following code will print the sender and the tokens received on each incoming transaction:
parameter
The parameter object containing:
entrypoint
property with the name of the entrypoint (string
)
value
with the parameter value (the exact type of the value will depend on the code of the contract)
dbContext
The DbContext to store data to.
indexingContext
The TransactionIndexingContext with additional information about the call.