-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathservice.go
40 lines (34 loc) · 1.18 KB
/
service.go
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
package finam
// методы создания нужных сервисов по api
// NewGetPortfolioService init portfоlio service
func (c *Client) NewGetPortfolioService() *GetPortfolioService {
return &GetPortfolioService{c: c}
}
// NewCandlesService init candles service
// обязательные параметры: board, symbol, timeFrame
func (c *Client) NewCandlesService(board, symbol string, timeFrame TimeFrame) *CandlesService {
return &CandlesService{
c: c,
board: board,
symbol: symbol,
timeFrame: timeFrame,
}
}
// NewSecurityService init security service
func (c *Client) NewSecurityService() *SecurityService {
return &SecurityService{c: c}
}
// NewGetOrderService init GetOrder Service
func (c *Client) NewGetOrderService() *GetOrderService {
return &GetOrderService{c: c,
includeActive: true, // сразу проставим "Вернуть активные заявки"
}
}
// NewCancelOrderService init CancelOrder Service
// обязательные параметры: id
func (c *Client) NewCancelOrderService(transactionId int64) *CancelOrderService {
return &CancelOrderService{
c: c,
transactionId: transactionId,
}
}