TopicReader API Reference
This document provides a concise API reference for the TopicReader
class within the Hedera DID SDK for JavaScript. This class is responsible for reading messages from the Hedera network topic.
Class Diagram
The class diagram below illustrates the core methods of the TopicReader
interface for interacting with the Hedera network.

Methods
fetchAllToDate
fetchAllToDate(topicId: string, network: Network): Promise<TopicReaderMessage[]>
Fetches all messages from a topic from the start to the end of the topic.
- Parameters
-
-
topicId
: The ID of the topic to fetch messages from. -
network
: The Hedera network to use.
-
- Returns
-
An array of messages from the topic.
fetchFrom
fetchFrom(topicId: string, network: Network, options: TopicReaderOptions): Promise<TopicReaderMessage[]>
Fetches messages from a topic from a specific start time to an end time.
- Parameters
-
-
topicId
: The ID of the topic to fetch messages from. -
network
: The Hedera network to use. -
options
: The options for the fetch. See TopicReaderOptions for more details.
-
- Returns
-
An array of messages from the topic.
Class Implementation
The Hashgraph DID SDK provides the TopicReader
class interface and implementations within its resolver
package. For further details, refer to the @hashgraph-did-sdk-js/resolver
package documentation.