Skip to content

Latest commit

 

History

History

events

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🎫 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