[API Reference](../README.md) > [Web3EventService](../classes/Web3EventService.md)

# Class: Web3EventService

Support for working with events that originate from Arc contracts and are served up by Web3.

For more information, see [Web3 Events](/Events.md#web3events).

## Hierarchy

**Web3EventService**

## Index

### Methods

* [createEntityFetcherFactory](Web3EventService.md#createEntityFetcherFactory)
* [createEventFetcherFactory](Web3EventService.md#createEventFetcherFactory)

---

## Methods

<a id="createEntityFetcherFactory"></a>

###  createEntityFetcherFactory

▸ **createEntityFetcherFactory**<`TEntity`,`TEventArgs`>(eventFetcherFactory: *[EventFetcherFactory](../#EventFetcherFactory)<`TEventArgs`>*, transformEventCallback: *[TransformEventCallback](../#TransformEventCallback)<`TEntity`, `TEventArgs`>*, baseArgFilter?: *`any`*): [EntityFetcherFactory](../#EntityFetcherFactory)<`TEntity`, `TEventArgs`>

*Defined in [web3EventService.ts:154](https://github.com/daostack/arc.js/blob/6f704389/lib/web3EventService.ts#L154)*

Converts a `EventFetcherFactory<TEventArgs>` into a `EntityFetcherFactory<TEntity, TEventArgs>`. So whenever a web3 event is received by the given `EventFetcherFactory`, we transform the `TEventArgs` into `TEntities`.

Note that the callback parameter of `EntityFetcher.get` is optional; you may alternatively obtain the promise of a `Array<TEntity>` from the return value of `get`.

See [Arc Web3 Events in Arc.js](/Events.md#web3events).

**Type parameters:**

#### TEntity 
#### TEventArgs 
**Parameters:**

| Param | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| eventFetcherFactory | [EventFetcherFactory](../#EventFetcherFactory)<`TEventArgs`> | - |  \- |
| transformEventCallback | [TransformEventCallback](../#TransformEventCallback)<`TEntity`, `TEventArgs`> | - |  Function to convert an instance of TEventArgs into the promise of an instance of TEntity. If it returns \`undefined\` then no entity is returned for that event, so this is a programatic way in which events can be filtered. |
| `Default value` baseArgFilter | `any` |  {} |  arg filter to always merge into any supplied argFilter. |

**Returns:** [EntityFetcherFactory](../#EntityFetcherFactory)<`TEntity`, `TEventArgs`>

___
<a id="createEventFetcherFactory"></a>

###  createEventFetcherFactory

▸ **createEventFetcherFactory**<`TEventArgs`>(baseEvent: *`any`*, preProcessEvent?: *[PreProcessEventCallback](../#PreProcessEventCallback)<`TEventArgs`>*, baseArgFilter?: *`any`*): [EventFetcherFactory](../#EventFetcherFactory)<`TEventArgs`>

*Defined in [web3EventService.ts:32](https://github.com/daostack/arc.js/blob/6f704389/lib/web3EventService.ts#L32)*

Returns a function that creates an EventFetcher. For subclasses to use to create their event handlers. This is identical to what you get with Truffle, except with enhancements.

Note that the callback parameter of `EventFetcher.get` is optional; you may alternatively obtain the promise of a `Array<TEventArgs>` from the return value of `get`.

For more information, see [Web3 Events](/Events.md#web3events).
*__type__*: TEventArgs - name of the event args (EventResult) interface, like NewProposalEventResult

**Type parameters:**

#### TEventArgs 
**Parameters:**

| Param | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| baseEvent | `any` | - |  the event from the Truffle contract. |
| `Optional` preProcessEvent | [PreProcessEventCallback](../#PreProcessEventCallback)<`TEventArgs`> | - |  optionally supply this to modify the err and log arguments before they are passed to the \`get\`/\`watch\` callback. |
| `Default value` baseArgFilter | `any` |  {} |  arg filter to always merge into any supplied argFilter. |

**Returns:** [EventFetcherFactory](../#EventFetcherFactory)<`TEventArgs`>

___

