1.0.2 • Published 7 days ago

@colony/events v1.0.2

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
7 days ago

🎫 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

1.0.3-next.0

2 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

5 months ago

0.3.0

5 months ago

0.3.0-next.2

9 months ago

0.3.0-next.4

7 months ago

0.3.0-next.3

8 months ago

0.2.1-next.1

10 months ago

0.2.1-next.0

11 months ago

0.2.0

1 year ago

0.1.0

1 year ago