Indexing Entrypoint Call
The @indexEntrypoint decorator can be used to mark an indexer method that will be listening for entrypoint calls on a contract. Please note that if you are interested in all incoming transactions regardless of the entrypoint, @indexTransaction is better suited for the job.
When a transaction calling a given named entrypoint is detected on an indexed contract, the method will be invoked with detailed information about the call.

Parameters

The following parameters will be passed to the indexing method:
Name
Description
parameter
The entrypoint parameter value. The exact type will depend on the code of the contract.
dbContext
The DbContext to store data to.
indexingContext
The TransactionIndexingContext with additional information about the call.

Example

The following code will print the value of the property bar every time the contract's entrypoint foo is called:
1
interface FooEntrypointParameter {
2
bar: string;
3
}
4
5
export class MyContractIndexer {
6
@indexEntrypoint('foo')
7
async indexFoo(
8
parameter: FooEntrypointParameter,
9
dbContext: DbContext,
10
indexingContext: TransactionIndexingContext,
11
): Promise<void> {
12
console.log(parameter.bar);
13
}
14
}
Copied!
Copy link