Aragon Connect 0.4.0
This version includes a new package for React apps, app filters, and improved app metadata.
Contributors for this release: @0xGabi, @ajsantander, @bpierre, @fabriziovigevani, @sohkai 🕺
Connect 💙 React
Aragon Connect now offers a dedicated library for React.
Usage
Start by adding it to your React project:
yarn add @aragon/connect-react
And use it this way:
import { Connect, useApps, useOrganization } from '@aragon/connect-react'
function App() {
const [org] = useOrganization()
const [apps] = useApps()
return (
<>
<h1>{org?.name || 'Loading'}</h1>
<ul>
{apps.map(app => <li>{app.name}</li>)}
</ul>
</>
)
}
export default () => (
<Connect
location="myorg.aragonid.eth"
connector="thegraph"
>
<App />
</Connect>
)
Please have a look at the documentation for more details.
Pull request
- Connect for React API (#52)
App filters 🗂️
The different app methods now include filters, making it easier and more performant to select a particular set of apps.
Usage
For example, this is how you would have instantiated a Voting app connector in the past:
// Connect to the organization.
const org = await connect('example.aragonid.eth', 'thegraph')
// Fetch all the apps from it.
const apps = await org.apps()
// Find the App instance we want.
const votingInfo = apps.find(app => app.appName === 'voting.aragonpm.eth')
// Instantiate the Voting connector using the address found.
const voting = new Voting(votingInfo.address, subgraphUrl)
And this is how it can be done now:
// Connect to the organization.
const org = await connect('example.aragonid.eth', 'thegraph')
// Instantiate the Voting connector directly by fetching the app address from the parameters.
const voting = new Voting(await org.app('voting').address, subgraphUrl)
Filter types
Filters can be passed as a first parameter to the following Organization
methods: app(filters)
, apps(filters)
, onApp(filters)
, and onApps(filters)
.
They can be of different types:
- An app name (e.g.
"voting.aragonpm.eth"
) or its short format ("voting"
). - An app address:
"0x…"
. - An array of app names:
["voting", "finance"]
. - An array of app addresses
["0x…", "0x…"]
. - An object can also be passed to disable the automatic detection:
{ address: "0x…" }
{ address: ["0x…", "0x…"] }
{ appName: "voting" }
.{ appName: ["voting", "finance"] }
.
Pull request
- App filters + align Organization methods (#111)
Improved apps metadata 🎁
The metadata attached to apps is now more reliable and consistent.
- When an app metadata is not available on the connector (e.g. TheGraph), it is then fetched from the Aragon IPFS node by default.
- System apps (Kernel, ACL, etc.) now contain metadata like the other apps.
Pull requests
- Add overrides for apps without aragonPM repos (#114)
- Add IPFS fallback logic to fetch metadata (#89)
- Use an static method to create Entities + Split Data and Metadata (#110)
New utilities 🔧
A series of utilities have been added to the @aragon/connect-core
and @aragon/connect
packages.
findAppMethodFromIntent()
decodeCallScript()
encodeCallScript()
describeTransaction()
describeTransactionPath()
describeScript()
fetchMetadata()
Pull request
- Add descriptions utils for evm scripts and transactions (#101)
Documentation updates 📚
An important number of improvements has been made to the documentation since the last release.
Check out our new guides, and let us know what you think!
Pull requests
- Docs: add advance information about Connectors (#95)
- Docs: Aragon Basics (#98)
- Docs: dedupe subgraph and connector guides (#88)
- Docs: review (#72)
- Docs: Small fixes & correct links (#92)
Other changes
- Refactor: Use an static method to create Entities + Split Data and Metadata (#110)
- Populate App#name for system apps (#112)
- Tokens subgraph: Update totalSupply if tokens minted or burned (#79)
- Renamed App and Repo + Improve a callback type (#93)
- Feat: Add IPFS fallback logic to fetch metadata (#89)
- Fix broken tests (#96)
Upgrade from 0.3.0
Application
has been renamedApp
.Repository
has been renamedRepo
.