IndexerModule

@Module
object IndexerModule

Hilt module for Indexer component dependencies.

Provided Dependencies:

  • IndexerClient: WebSocket client for Midnight Indexer API

  • UtxoDatabase: Room database for UTXO storage

  • UtxoManager: UTXO processing and balance calculation

  • BalanceRepository: Public API for balance queries

  • SyncStateManager: Sync progress persistence

  • SubscriptionManagerFactory: Factory for creating SubscriptionManager instances

Note on SubscriptionManager: SubscriptionManager is NOT a singleton because each instance should manage a single address subscription. Use SubscriptionManagerFactory to create instances.

Functions

Link copied to clipboard
@Provides
@Singleton
fun provideBalanceRepository(utxoManager: UtxoManager, indexerClient: IndexerClient): BalanceRepository

Provide BalanceRepository singleton.

Link copied to clipboard
@Provides
@Singleton
fun provideDustDao(database: UtxoDatabase): DustDao

Provide DustDao from database.

Link copied to clipboard
@Provides
@Singleton
fun provideDustStateDataStore(context: Context): DataStore<Preferences>

Provide DataStore for dust state persistence.

Link copied to clipboard
@Provides
@Singleton
fun provideIndexerClient(networkConfig: NetworkConfig): IndexerClient

Provide IndexerClient singleton.

Link copied to clipboard
@Provides
@Singleton
fun provideShieldedStateDataStore(context: Context): DataStore<Preferences>
Link copied to clipboard
@Provides
fun provideSubscriptionManagerFactory(context: Context, indexerClient: IndexerClient, utxoManager: UtxoManager, syncStateManager: SyncStateManager, networkRepository: NetworkRepository): SubscriptionManagerFactory

Provide SubscriptionManagerFactory.

Link copied to clipboard
@Provides
@Singleton
fun provideSyncStateManager(context: Context): SyncStateManager

Provide SyncStateManager singleton.

Link copied to clipboard
@Provides
@Singleton
fun provideUtxoDatabase(context: Context): UtxoDatabase

Provide UtxoDatabase singleton.

Link copied to clipboard
@Provides
@Singleton
fun provideUtxoManager(database: UtxoDatabase): UtxoManager

Provide UtxoManager singleton.