forked from preichenberger/go-coinbasepro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
withdrawals.go
31 lines (26 loc) · 982 Bytes
/
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
package coinbasepro
import (
"fmt"
)
type WithdrawalCrypto struct {
Currency string `json:"currency"`
Amount string `json:"amount"`
CryptoAddress string `json:"crypto_address"`
}
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
}