Algorand(- {required AlgodClient algodClient,
- required IndexerClient indexerClient}
)
Implementation
Algorand({required this.algodClient, required this.indexerClient}) {
// TODO Provide services
final transactionService = TransactionService(algodClient.client);
final nodeService = NodeService(algodClient.client);
// TODO Inject Repositories
_nodeRepository = NodeRepository(service: nodeService);
_transactionRepository = TransactionRepository(
nodeService: nodeService,
transactionService: transactionService,
);
_accountRepository = AccountRepository(
accountService: AccountService(algodClient.client),
);
_applicationRepository = ApplicationRepository(
applicationService: ApplicationService(algodClient.client),
);
// TODO Inject Managers
_assetManager = AssetManager(transactionRepository: _transactionRepository);
_applicationManager = ApplicationManager(
applicationRepository: _applicationRepository,
);
// TODO Inject and provide the Algorand Indexer
_indexer = AlgorandIndexer(
indexerRepository: IndexerRepository(
indexerService: IndexerService(indexerClient.client),
accountService: AccountService(indexerClient.client),
assetService: AssetService(indexerClient.client),
),
);
}