-
Notifications
You must be signed in to change notification settings - Fork 1
/
event-filter.ts
37 lines (34 loc) · 1023 Bytes
/
event-filter.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { BlockchainEventTypes, BlockchainEventConfig } from '../types';
/**
* A class for filtering blockchain events.
*/
export default class EventFilter {
/** The event filter ID. */
public readonly id: string;
/** The blockchain event type. */
public readonly type: BlockchainEventTypes;
/** The blockchain event configuration. */
public readonly config: BlockchainEventConfig;
/**
* Creates a new EventFilter object.
* @param {string} id The event filter ID object.
* @param {BlockchainEventTypes} type The blockchain event type value.
* @param {BlockchainEventConfig} config The blockchain event configuration object.
*/
constructor(id: string, type: BlockchainEventTypes, config: BlockchainEventConfig) {
this.id = id;
this.type = type;
this.config = config;
}
/**
* Converts to a javascript object.
* @returns {Object} The javascript object.
*/
toObject() {
return {
id: this.id,
type: this.type,
config: this.config,
};
}
}