hiero-ledger / hiero-ledger/hiero-enterprise-java
Feature: Smart Contract Event and Log Observation API
- Dominant language
- Java
- Stars
- 6
- Forks
- 21
- Avg merge
- 10h 27m
- Merged PRs (30d)
- 37
Description
### Description
Currently, `hiero-enterprise-java` provides excellent support for deploying and calling functions of smart contracts via the `SmartContractClient`. However, it currently lacks an API to observe and query the **events and logs** emitted by those smart contracts.
This functionality is crucial for enterprise applications that need to react to on-chain events (such as token mints, state changes, or custom application logic) emitted by Hiero smart contracts.
### Proposed Solution
- Introduce a data model mapping to the EVM event log format emitted by the Hiero Mirror Node (incorporating `topics`, `data`, `consensus_timestamp`, etc.).
- Introduce a high-level `ContractLogRepository` to abstract Mirror Node API polling for logs by `ContractId`.
- Provide framework-native implementations (Spring Boot Jackson / MicroProfile JSON-B) to seamlessly parse the paginated `/api/v1/contracts/{id}/results/logs` endpoints.
- Update sample applications to demonstrate fetching logs.
### References
* [Hedera Smart Contract Logs Mirror Node API](https://docs.hedera.com/hedera/sdks-and-apis/rest-api#get-/api/v1/contracts/-id-/results/logs)
* LFDT Mentorship Project Description: "Extending Hiero Enterprise Java with Smart Contract Event and Log APIs"
Contributor guide
Assessment
This issue has not been assessed yet.