-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path_portfolio.gs
33 lines (33 loc) · 1.16 KB
/
_portfolio.gs
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
class Portfolio { // Операции с портфелем пользователя
constructor(token) {
this.token = token;
}
list(brokerAccountId) {
var data = portfolio(this.token, brokerAccountId);
function portfolio(token, brokerAccountId) { // Получение портфеля клиента
var obj = {
method: 'GET',
path: 'portfolio'
}
if (!!brokerAccountId) {
obj.parametres.brokerAccountId = brokerAccountId;
}
return tinkoffApi_(obj, token);
}
return data;
}
Currencies(brokerAccountId) {
var data = portfolioCurrencies(this.token, brokerAccountId);
function portfolioCurrencies(token, brokerAccountId) { // Получение валютных активов клиента
var obj = {
method: 'GET',
path: 'portfolio/currencies'
}
if (!!brokerAccountId) {
obj.parametres.brokerAccountId = brokerAccountId;
}
return tinkoffApi_(obj, token);
}
return data;
}
}