🎫 Colony event contract bindings
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);
}
});
To build this package, run pnpm run build
in this directory. See the general development instructions for more information.
All contributions are welcome. Please read the Contributing Guidelines and review our Code of Conduct before submitting a PR.
GPL-3.0