-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathportfolio.go
32 lines (27 loc) · 973 Bytes
/
portfolio.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
package smartapigo
import (
"net/http"
)
// Holding is an individual holdings response.
type Holding struct {
Tradingsymbol string `json:"tradingsymbol"`
Exchange string `json:"exchange"`
ISIN string `json:"isin"`
T1Quantity string `json:"t1quantity"`
RealisedQuantity string `json:"realisedquantity"`
Quantity string `json:"quantity"`
AuthorisedQuantity string `json:"authorisedquantity"`
ProfitAndLoss string `json:"profitandloss"`
Product string `json:"product"`
CollateralQuantity string `json:"collateralquantity"`
CollateralType string `json:"collateraltype"`
Haircut string `json:"haircut"`
}
// Holdings is a list of holdings
type Holdings []Holding
// GetHoldings gets a list of holdings.
func (c *Client) GetHoldings() (Holdings, error) {
var holdings Holdings
err := c.doEnvelope(http.MethodGet, URIGetHoldings, nil, nil, &holdings, true)
return holdings, err
}