This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
transfer.go
69 lines (59 loc) · 1.95 KB
/
transfer.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package kumex
import "net/http"
// A TransferOutModel represents a transfer out record.
type TransferOutModel struct {
ApplyId string `json:"applyId"`
}
// TransferOut Transfer Funds to KuCoin-Main Account.
func (as *ApiService) TransferOut(bizNo, amount string) (*ApiResponse, error) {
p := map[string]string{
"bizNo": bizNo,
"amount": amount,
}
req := NewRequest(http.MethodPost, "/api/v1/transfer-out", p)
return as.Call(req)
}
// A TransferOutModel represents a transfer out record.
type TransferOutV2Model struct {
ApplyId string `json:"applyId"`
}
// TransferOut Transfer Funds to KuCoin-Main Account.
func (as *ApiService) TransferOutV2(bizNo, amount, currency string) (*ApiResponse, error) {
p := map[string]string{
"bizNo": bizNo,
"amount": amount,
"currency": currency,
}
req := NewRequest(http.MethodPost, "/api/v2/transfer-out", p)
return as.Call(req)
}
// A TransferModel represents a transfer record.
type TransferModel struct {
ApplyId string `json:"applyId"`
Currency string `json:"currency"`
Status string `json:"status"`
Amount string `json:"amount"`
Reason string `json:"reason"`
Offset int64 `json:"offset"`
CreatedAt int64 `json:"createdAt"`
}
// A TransfersModel represents a transfer list.
type TransfersModel []*TransferModel
// TransferList returns a list of deposit.
func (as *ApiService) TransferList(params map[string]string, pagination *PaginationParam) (*ApiResponse, error) {
pagination.ReadParam(params)
req := NewRequest(http.MethodGet, "/api/v1/transfer-list", params)
return as.Call(req)
}
// CancelTransferModel represents the result of CancelWithdrawal().
type CancelTransferModel struct {
ApplyId string `json:"applyId"`
}
// CancelTransfer Cancel Transfer-Out Request.
func (as *ApiService) CancelTransfer(applyId string) (*ApiResponse, error) {
p := map[string]string{
"applyId": applyId,
}
req := NewRequest(http.MethodDelete, "/api/v1/cancel/transfer-out", p)
return as.Call(req)
}