-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
withdraw.go
50 lines (45 loc) · 1.32 KB
/
withdraw.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
48
49
50
package coincheck
import (
"context"
"net/http"
)
// GetBankAccountsResponse represents the response from the GetBankAccounts API.
type GetBankAccountsResponse struct {
// Success is a boolean value that indicates the success of the API call.
Success bool `json:"success"`
// Data is a list of bank accounts.
Data []BankAccount
}
// BankAccount represents a bank account.
type BankAccount struct {
// ID is the bank account ID.
ID int `json:"id"`
// BankName is the bank name.
BankName string `json:"bank_name"`
// BranchName is the branch name.
BranchName string `json:"branch_name"`
// BankAccountType is the bank account type.
BankAccountType string `json:"bank_account_type"`
// Number is the bank account number.
Number string `json:"number"`
// Name is the bank account name.
Name string `json:"name"`
}
// GetBankAccounts returns a list of bank account you registered (withdrawal).
// API: GET /api/bank_accounts
// Visibility: Private
func (c *Client) GetBankAccounts(ctx context.Context) (*GetBankAccountsResponse, error) {
req, err := c.createRequest(ctx, createRequestInput{
method: http.MethodGet,
path: "/api/bank_accounts",
private: true,
})
if err != nil {
return nil, err
}
var output GetBankAccountsResponse
if err := c.do(req, &output); err != nil {
return nil, err
}
return &output, nil
}