[API Reference](../README.md) > [EventFetcher](../interfaces/EventFetcher.md)



# Interface: EventFetcher


Returned by EventFetcherFactory<teventargs>. See web3 documentation article for more information about events: [https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-events](https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-events)</teventargs>
*__type__*: TEventArgs The type of the `args` object.


## Type parameters
#### TEventArgs 

## Properties
<a id="get"></a>

###  get

**●  get**:  *`function`* 

*Defined in [web3EventService.ts:519](https://github.com/daostack/arc.js/blob/f343aa24/lib/web3EventService.ts#L519)*



Get an array of `DecodedLogEntryEvent` from Web3, given the filter supplied to the EventFetcherFactory. You may supply a callback, which will be given the array, or you may accept the promise of the array from the return value of `get`. If `requiredDepth` is set then will not invoke the callback until the transaction has been mined to the requiredDepth.

#### Type declaration
►(callback?: *[EventGetCallback](../#EventGetCallback)`TEventArgs`*, requiredDepth?: *`number`*): `Promise`.<`Array`.<`DecodedLogEntryEvent`.<`TEventArgs`>>>



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| callback | [EventGetCallback](../#EventGetCallback)`TEventArgs`   |  - |
| requiredDepth | `number`   |  - |





**Returns:** `Promise`.<`Array`.<`DecodedLogEntryEvent`.<`TEventArgs`>>>






___

<a id="subscribe"></a>

###  subscribe

**●  subscribe**:  *`function`* 

*Defined in [web3EventService.ts:540](https://github.com/daostack/arc.js/blob/f343aa24/lib/web3EventService.ts#L540)*



Watch for `DecodedLogEntryEvent`s from Web3, given the filter supplied to the EventFetcherFactory. The Pub.Sub is published once per event firing. `subscribe` returns the subscription on which you must remember to call `unsubscribe` when you are done watching. If `requiredDepth` is set then will not invoke the callback until the transaction has been mined to the requiredDepth.

Supply whatever name you want for `eventName`. This enables you to scope event handlers across event types and schemes.

#### Type declaration
►(eventName: *`string`*, callback?: *[EventWatchSubscriptionCallback](../#EventWatchSubscriptionCallback)`TEventArgs`*, requiredDepth?: *`number`*): [IEventSubscription](IEventSubscription.md)



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| eventName | `string`   |  - |
| callback | [EventWatchSubscriptionCallback](../#EventWatchSubscriptionCallback)`TEventArgs`   |  - |
| requiredDepth | `number`   |  - |





**Returns:** [IEventSubscription](IEventSubscription.md)






___

<a id="watch"></a>

###  watch

**●  watch**:  *`function`* 

*Defined in [web3EventService.ts:528](https://github.com/daostack/arc.js/blob/f343aa24/lib/web3EventService.ts#L528)*



Watch for `DecodedLogEntryEvent`s from Web3, given the filter supplied to the EventFetcherFactory. The callback is invoked once per event firing. If `requiredDepth` is set then will not invoke the callback until the transaction has been mined to the requiredDepth.

#### Type declaration
►(callback: *[EventWatchCallback](../#EventWatchCallback)`TEventArgs`*, requiredDepth?: *`number`*): `void`



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| callback | [EventWatchCallback](../#EventWatchCallback)`TEventArgs`   |  - |
| requiredDepth | `number`   |  - |





**Returns:** `void`






___


## Methods
<a id="stopWatching"></a>

###  stopWatching

► **stopWatching**(callback?: *[fnVoid](../#fnVoid)*): `void`



*Defined in [web3EventService.ts:547](https://github.com/daostack/arc.js/blob/f343aa24/lib/web3EventService.ts#L547)*



Stop watching the event.


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| callback | [fnVoid](../#fnVoid)   |  - |





**Returns:** `void`





___

<a id="stopWatchingAsync"></a>

###  stopWatchingAsync

► **stopWatchingAsync**(): `Promise`.<`void`>



*Defined in [web3EventService.ts:552](https://github.com/daostack/arc.js/blob/f343aa24/lib/web3EventService.ts#L552)*



Asynchronously stop watching the event, for environments where synchronous methods are not allowed.




**Returns:** `Promise`.<`void`>





___


