Client: How can I get the ABI with event of installed apps?

Created on 29 Jan 2020  路  7Comments  路  Source: aragon/client

I'm creating an app that needs to list other application events within my organization.

How can I get the ABI with the list of events from other apps? I can access all appId from installedApps but I can't find the events.

I can fetch some information based on the package manager with npx aragon apm info voting --apmRepoVersion 1.0.0, but the result only contains the ABI for the methods and not the events.

All 7 comments

@blackinno Perhaps we can move this to aragon.chat; it depends on the app.

Are you creating an Aragon app that will be run inside the client? If so, you can get the list of installed apps with an API call (installedApps()). If you're creating a totally separate app, you'll need to do some IPFS querying to get the ABIs from aragonPM (for example, a deployed artifact.json from aragonPM with the ABI inside of it).

@sohkai Yes. I create an Aragon app running inside the client. I can get the list of installed apps from InstalledApps() but I can't get ABIs of the list of installed apps because I need events from each ABI.

My question:

  1. Do you have any suggestions to get ABIs of the list of installed apps inside the client?
  1. Should I use @aragon/apm or @aragon/toolkit on the frontend side?
    I try to use @aragon/apm like the code below in the frontend and I get the error like:
    Screen Shot 2563-02-05 at 14 20 43

Screen Shot 2563-02-05 at 14 21 05

Also, I try to use @aragon/toolkit like the code below in the frontend and I get the error like:

Screen Shot 2563-02-05 at 14 36 50

Screen Shot 2563-02-05 at 14 37 05

*My code using @aragon/apm *

//App.js

function App() {
  const { api, appState, installedApps } = useAragonApi()
  const { appearance } = useGuiStyle()
  const [opened, setOpened] = useState(false)
  const { processes, isSyncing } = appState

  const open = () => {
    setOpened(true)
    const apm = APM(api.web3Eth, { ensRegistryAddress: '0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1' })
    apm
      .getLatestVersion('voting', 1000)
      .then(res => console.log(res))
      .catch(console.error)
  }

return (
<Main>
  ...
</Main>)
}

*My code using @aragon/toolkit *

//App.js

function App() {
  const { api, appState, installedApps } = useAragonApi()
  const { appearance } = useGuiStyle()
  const [opened, setOpened] = useState(false)
  const { processes, isSyncing } = appState

  const open = () => {
    setOpened(true)
    getApmRepo(installedApps[2].appId, 30000).then(console.log).catch(console.error)
  }

return (
<Main>
  ...
</Main>)
}

@blackinno Ahh gotcha, yes, getting the ABI from getApps() needs https://github.com/aragon/aragon.js/issues/416. Will make that available soon!

@sohkai Greate, waiting for new publish

@blackinno Sorry this took a bit to land; we were busy with a few other efforts surrounding the Court.

This is now available as part of 0.8.8, which you can grab and run now, or otherwise wait to use it from a new version of the CLI (v7.1.1) that will be published in the next day or so.

@sohkai the part of 0.8.8, what are dependencies I should update before the new version is coming?

@blackinno If you have aragon/aragon cloned locally, you should just be able to do a yarn to upgrade all the dependencies :).

If you have the CLI installed, you'll have to grab the latest one (either through a yarn upgrade @aragon/[email protected] or npm install @aragon/[email protected]. This latest CLI release already includes 0.8.8.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lkngtn picture lkngtn  路  4Comments

john-light picture john-light  路  4Comments

luisivan picture luisivan  路  3Comments

ricburton picture ricburton  路  3Comments

john-light picture john-light  路  3Comments