-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathuser_transactions.go
36 lines (31 loc) · 1.02 KB
/
user_transactions.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
package btcturk
import (
"fmt"
)
// https://docs.btcturk.com/#user-transactions
type UserTransactions struct {
Price float64 `json:"price"`
NumeratorSymbol string `json:"numeratorSymbol"`
DenominatorSymbol string `json:"denominatorSymbol"`
OrderType string `json:"orderType"`
ID string `json:"id"`
Timestamp float64 `json:"timestamp"`
Amount float64 `json:"amount"`
Fee float64 `json:"fee"`
Tax float64 `json:"tax"`
}
// Example Params : ?type=buy&type=sell&symbol=btc&symbol=try&symbol=usdt
func (c *Client) UserTransactions() ([]UserTransactions, error) {
req, err := c.newRequest("GET", fmt.Sprintf("/api/v1/users/transactions/trade?%s", c.params.Encode()), nil)
if err != nil {
return []UserTransactions{}, err
}
if err := c.auth(req); err != nil {
return []UserTransactions{}, err
}
var response []UserTransactions
if _, err = c.do(req, &response); err != nil {
return []UserTransactions{}, err
}
return response, nil
}