@colony/events
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

🎫 Colony event contract bindings

Discord

@colony/events

This package contains pre-compiled Colony event contract bindings. These bindings contain types and ABIs for all events for all contracts across all versions in the Colony Network. You could use them in conjunction with the EventManger from Colony SDK:

import { providers } from 'ethers';
import { IColonyEvents__factory as ColonyEventsFactory } from '@colony/events';

import {
  type ColonyEvent,
  ColonyEventManager,
  ColonyRpcEndpoint,
  MetadataType,
} from '@colony/sdk';

const provider = new providers.JsonRpcProvider(ColonyRpcEndpoint.Gnosis);

const manager = new ColonyEventManager(provider);
const colonyEventSource = manager.createEventSource(ColonyEventsFactory);

// Filter all events that signal the creation of a new team within a Colony
const domainEvents = manager.createFilter(
    colonyEventSource,
    'DomainAdded(address,uint256)',
    colonyAddress,
);

manager.provider.on('block', async (no) => {
    const events = await manager.getMultiEvents(domainEvents);
    if (events.length) {
        console.log(events);
    }
});

Building

To build this package, run pnpm run build in this directory. See the general development instructions for more information.

Contributing

All contributions are welcome. Please read the Contributing Guidelines and review our Code of Conduct before submitting a PR.

License

GPL-3.0

Readme

Keywords

none

Package Sidebar

Install

npm i @colony/events

Weekly Downloads

105

Version

3.0.0

License

GPL-3.0-only

Unpacked Size

1.18 MB

Total Files

164

Last publish

Collaborators

  • jakubcolony
  • kronovet
  • rdig
  • chmanie
  • area