-
Notifications
You must be signed in to change notification settings - Fork 145
/
withdrawals.go
32 lines (27 loc) · 1 KB
/
withdrawals.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 coinbasepro
import (
"fmt"
)
type WithdrawalCrypto struct {
Currency string `json:"currency"`
Amount string `json:"amount"`
CryptoAddress string `json:"crypto_address"`
ProfileID string `json:"profile_id"`
}
type WithdrawalCoinbase struct {
Currency string `json:"currency"`
Amount string `json:"amount"`
CoinbaseAccountID string `json:"coinbase_account_id"`
}
func (c *Client) CreateWithdrawalCrypto(newWithdrawalCrypto *WithdrawalCrypto) (WithdrawalCrypto, error) {
var savedWithdrawal WithdrawalCrypto
url := fmt.Sprintf("/withdrawals/crypto")
_, err := c.Request("POST", url, newWithdrawalCrypto, &savedWithdrawal)
return savedWithdrawal, err
}
func (c *Client) CreateWithdrawalCoinbase(newWithdrawalCoinbase *WithdrawalCoinbase) (WithdrawalCoinbase, error) {
var savedWithdrawal WithdrawalCoinbase
url := fmt.Sprintf("/withdrawals/coinbase-account")
_, err := c.Request("POST", url, newWithdrawalCoinbase, &savedWithdrawal)
return savedWithdrawal, err
}