aragon.js icon indicating copy to clipboard operation
aragon.js copied to clipboard

API: add a easy way to fetch an app's artifact or manifest

Open sembrestels opened this issue 5 years ago • 2 comments

In #371 the api.getApps() function is filtered and there isn't a direct way to get apps' manifest and artifact anymore. These are the only exposed details:

{
  appAddress: '0x...',  // currently running app's address (either proxy or full app contract)
  appId: '0x...',  // app's appId
  appImplementationAddress: '0x...',  // base implementation address (only available if running is a proxy contract)
  identifier: '...',  // self-declared app identifier
  isForwarder: bool,  // whether this app is a forwarder or not
  kernelAddress: '0x...',  // kernel the app is installed on
  name: '...',  // name of the app (if available)
}

I propose to include the manifest.json and the artifact.json URIs, so developers can still access them with a simple fetch(). For example, for the voting app it would look like:

{
  ...,
  artifact: '/ipfs/QmcgFogXwcHwHZFHJ2JUsVauFPXDWfGQ3aeYTjfayBKAYW/artifact.json',
  manifest: '/ipfs/QmcgFogXwcHwHZFHJ2JUsVauFPXDWfGQ3aeYTjfayBKAYW/manifest.json',
}

I find installed apps artifact.json info especially relevant because it exposes the ABI and the roles of the other apps, which can be useful. In the committees app, we use it to get the names of the other apps roles.

sembrestels avatar Dec 18 '19 21:12 sembrestels

Good to know @sembrestels, thanks for bringing this up!

I intentionally limited the amount of information passed back through getApps() to avoid creating a large API surface area that would be difficult to change or constrain in the future.

I do agree on having the abi and roles present to help other apps construct actions or know more about how to interact with the other apps. Giving the entire artifact / manifest is likely not something we'll do immediately as we've been meaning to make changes to the schema.

sohkai avatar Jan 31 '20 12:01 sohkai

abi and roles have been made available in #425.

sohkai avatar Feb 05 '20 23:02 sohkai