Skip to content

Commit

Permalink
feat: return list of contracts that node is currently using in the in…
Browse files Browse the repository at this point in the history
…fo page
  • Loading branch information
enrique committed Apr 27, 2023
1 parent ef48a20 commit 90438c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/info/info.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ export class InfoController {

const providerURL = new URL(this.nvmService.web3ProviderUri())

const contractInstances = nevermined.keeper.getAllInstances()
const keys = Object.keys(contractInstances).filter(
(key) => contractInstances[key]?.contract?.address !== undefined,
)
const contracts = keys.map((key) => ({ [key]: contractInstances[key].contract.address }))

return {
APIversion: packageJson.version,
docs: `${pathEndpoint}api/v1/docs`,
Expand All @@ -62,7 +68,7 @@ export class InfoController {
'provenance-enabled': provenanceEnabled,
'artifacts-folder': artifactDir,
'circuits-folder': circuitDir,
contracts: [],
contracts: contracts,
'external-contracts': [],
'keeper-version': await contractHandler.getVersion('DIDRegistry', artifactDir),
'provider-address': provider.getId(),
Expand Down

0 comments on commit 90438c8

Please sign in to comment.