npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tecommons/connect-hatch

v2.1.5

Published

Aragon connector to access and interact with the hatch contract

Readme

Hatch Connector

Connector for the Hatch frontend implemented using Aragon Connect. It connects to a hatch subgraph created using The Graph indexing protocol.

The hatch subgraph collects, stores and indexes hatch-related data from the blockchain and serves it through a GraphQL endpoint. The connector is an abstraction over this subgraph which offers an API that can be use by any client to fetch data.

API Reference

See API.md

Usage

Set up

  1. Add the following dependencies to your project:

    yarn add @1hive/connect
    yarn add @tecommons/connect-hatch
  2. Import them:

    import connect from '@1hive/connect'
    import connectHatch from '@tecommons/connect-hatch'
  3. Set up the connector:

    const org = await connect(DAO_ADDRESS_OR_ENS, 'thegraph', { network: CHAIN_ID })
        
    const hatchApp = await org.app('marketplace-hatch')
    
    const hatchConnector = await connectHatch(hatchApp)

Set up in a React App

  1. Add the following dependencies to your project:

    yarn add @1hive/connect-react
    yarn add @tecommons/connect-hatch
  2. Wrap your main <App/> component in the <Connect/> component provided by the @1hive/connect-react library.

    import { Connect } from '@1hive/connect-react'
    
    <Connect
        location={DAO_ADDRESS_OR_ENS}
        connector="thegraph"
        options={{
        network: CHAIN_ID,
        }}
    >
        <App />
    </Connect>
  3. Set up the connector:

    import {
        useApp,
    } from '@1hive/connect-react'
    
    function App() {
        const [hatchConnector, setHatchConnector] = useState(null)
        const [hatchApp] = useApp('marketplace-hatch')
    
        useEffect(() => {
            if (!hatchApp) {
                return
            }
    
            let cancelled = false
    
            const fetchHatchConnector = async () => {
                try {
                    const hatchConnector = await connectHatch(hatchApp)
    
                    if (!cancelled) {
                        setHatchConnector(hatchConnector)
                    }
                } catch (err) {
                    console.error(`Error fetching hatch connector: ${err}`)
                }
            }
    
            fetchHatchConnector()
    
            return () => {
                cancelled = true
            }
        }, [hatchApp])
    }

Data fetch example

Below there is an example of how to fetch 100 contributors, sorted in ascending order by their total contribution amount and skipping the first 50.

const contributors = await hatchConnector.contributors({
    first: 100,
    skip: 50,
    orderBy: 'totalValue',
    orderDirection: 'asc',
})

Data updates subscription example

This is an example of how to set a contributors data subscription of the first 20 contributors, sorted in descending order by their total hatch token amount and skipping the first 5.

const handler = hatchConnector.onContributors(
    {
        first: 20,
        skip: 5,
        orderBy: 'totalAmount',
        orderDirection: 'desc',
    },
    contributors => {
        console.log('Updated contributors: ', contirbutors)
    }
)

// ...

handler.unsubscribe()

Contract call example

Below there is an example of how to call the contract using the connector to open the hatch.

const signer = ethers.getSigner()

const intent = await hatchConnector.open()
const openTxs = intent.transactions

for(let i = 0; i < openTxs.length; i++) {
    const txResponse = await signer.sendTransaction(openTxs[i])
    const txReceipt = await txResponse.wait()
}

For more information check out the Aragon Connect docs.

Contributing

We welcome community contributions!

Please check out our open Issues to get started.