-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApiControllerFactory.ts
63 lines (53 loc) · 1.78 KB
/
ApiControllerFactory.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import {
AccountApiController,
BlockApiController,
CallApiController,
ConstructionApiController,
EventsApiController,
MempoolApiController,
NetworkApiController,
SearchApiController,
} from '../openapi';
import { ApiServiceFactory } from './ApiServiceFactory';
export interface ApiControllerFactory {
account(): AccountApiController;
block(): BlockApiController;
events(): EventsApiController;
construction(): ConstructionApiController;
call(): CallApiController;
mempool(): MempoolApiController;
network(): NetworkApiController;
search(): SearchApiController;
}
/**
* Default implementation of the ApiControllerFactory.
*
* The implementation uses
*/
export class ApiControllerFactoryImpl implements ApiControllerFactory {
constructor(private readonly apiServiceFactory: ApiServiceFactory) {}
account(): AccountApiController {
return new AccountApiController(this.apiServiceFactory.account());
}
block(): BlockApiController {
return new BlockApiController(this.apiServiceFactory.block());
}
call(): CallApiController {
return new CallApiController(this.apiServiceFactory.call());
}
construction(): ConstructionApiController {
return new ConstructionApiController(this.apiServiceFactory.construction());
}
events(): EventsApiController {
return new EventsApiController(this.apiServiceFactory.events());
}
mempool(): MempoolApiController {
return new MempoolApiController(this.apiServiceFactory.mempool());
}
network(): NetworkApiController {
return new NetworkApiController(this.apiServiceFactory.network());
}
search(): SearchApiController {
return new SearchApiController(this.apiServiceFactory.search());
}
}