forked from kkohtaka/go-bitflyer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
executions.go
47 lines (36 loc) · 1.2 KB
/
executions.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
41
42
43
44
45
46
47
// Copyright (C) 2017 Kazumasa Kohtaka <kkohtaka@gmail.com> All right reserved
// This file is available under the MIT license.
package executions
import (
"net/http"
"github.com/google/go-querystring/query"
"github.com/kkohtaka/go-bitflyer/pkg/api/v1/markets"
"github.com/kkohtaka/go-bitflyer/pkg/api/v1/types"
)
type Request struct {
ProductCode markets.ProductCode `json:"product_code" url:"product_code"`
Pagination types.Pagination `json:",inline"`
}
type Response []Execution
type Execution struct {
ID int `json:"id"`
Side string `json:"side"`
Price float64 `json:"price"`
Size float64 `json:"size"`
ExecDate string `json:"exec_date"` // TODO: Treat timestamp as time.Time
BuyChildOrderAcceptanceID string `json:"buy_child_order_acceptance_id"`
SellChildOrderAcceptanceID string `json:"sell_child_order_acceptance_id"`
}
const (
APIPath string = "/v1/getexecutions"
)
func (req *Request) Method() string {
return http.MethodGet
}
func (req *Request) Query() string {
values, _ := query.Values(req)
return values.Encode()
}
func (req *Request) Payload() []byte {
return nil
}