forked from preichenberger/go-coinbasepro
/
paymentmethods.go
45 lines (38 loc) · 1.12 KB
/
paymentmethods.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
package coinbasepro
type PaymentMethod struct {
ID string `json:"id"`
Type string `json:"type"`
Name string `json:"name"`
Currency string `json:"currency"`
PrimaryBuy bool `json:"primary_buy"`
PrimarySell bool `json:"primary_sell"`
AllowBuy bool `json:"allow_buy"`
AllowSell bool `json:"allow_sell"`
AllowDeposit bool `json:"allow_deposit"`
AllowWithdraw bool `json:"allow_withdraw"`
Limits Limits `json:"limits"`
}
type Limits struct {
Buy []Limit
InstantBuy []Limit
Sell []Limit
Desposit []Limit
}
type Limit struct {
PeriodInDays int `json:"period_in_days"`
Total Total `json:"total"`
Remaining Remaining `json:"remaining"`
}
type Total struct {
Amount string `json:"amount"`
Currency string `json:"currency"`
}
type Remaining struct {
Amount string `json:"amount"`
Currency string `json:"currency"`
}
func (c *Client) GetPaymentMethods() ([]PaymentMethod, error) {
var paymentMethods []PaymentMethod
_, err := c.Request("GET", "/payment-methods", nil, nil, &paymentMethods)
return paymentMethods, err
}