-
Notifications
You must be signed in to change notification settings - Fork 145
/
fill.go
37 lines (32 loc) · 854 Bytes
/
fill.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
package coinbasepro
import (
"fmt"
)
type Fill struct {
TradeID int `json:"trade_id,int"`
ProductID string `json:"product_id"`
Price string `json:"price"`
Size string `json:"size"`
FillID string `json:"order_id"`
CreatedAt Time `json:"created_at,string"`
Fee string `json:"fee"`
Settled bool `json:"settled"`
Side string `json:"side"`
Liquidity string `json:"liquidity"`
}
type ListFillsParams struct {
OrderID string
ProductID string
Pagination PaginationParams
}
func (c *Client) ListFills(p ListFillsParams) *Cursor {
paginationParams := p.Pagination
if p.OrderID != "" {
paginationParams.AddExtraParam("order_id", p.OrderID)
}
if p.ProductID != "" {
paginationParams.AddExtraParam("product_id", p.ProductID)
}
return NewCursor(c, "GET", fmt.Sprintf("/fills"),
&paginationParams)
}