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
/
account.go
52 lines (45 loc) · 1.85 KB
/
account.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
package kumex
import (
"net/http"
)
// An AccountModel represents an account.
type AccountModel struct {
AccountEquity float64 `json:"accountEquity"`
UnrealisedPNL float64 `json:"unrealisedPNL"`
MarginBalance float64 `json:"marginBalance"`
PositionMargin float64 `json:"positionMargin"`
OrderMargin float64 `json:"orderMargin"`
FrozenFunds float64 `json:"frozenFunds"`
AvailableBalance float64 `json:"availableBalance"`
Currency string `json:"currency"`
}
// An AccountsModel is the set of *AccountModel.
type AccountsModel []*AccountModel
// AccountOverview returns a list of accounts.
// See the Deposits section for documentation on how to deposit funds to begin trading.
func (as *ApiService) AccountOverview(params map[string]string) (*ApiResponse, error) {
req := NewRequest(http.MethodGet, "/api/v1/account-overview", params)
return as.Call(req)
}
// A TransactionHistoryModel represents a sub-account user.
type TransactionHistoryModel struct {
Time string `json:"time"`
Type string `json:"type"`
Amount string `json:"amount"`
Fee string `json:"fee"`
AccountEquity string `json:"accountEquity"`
Status string `json:"status"`
Remarks string `json:"remark"`
Offset string `json:"offset"`
Currency string `json:"currency"`
}
// An TransactionHistoryListModel the set of *TransactionHistoryModel.
type TransactionHistoryListModel []*TransactionHistoryModel
// TransactionHistory returns a list of ledgers.
// Account activity either increases or decreases your account balance.
// Items are paginated and sorted latest first.
func (as *ApiService) TransactionHistory(params map[string]string, pagination *PaginationParam) (*ApiResponse, error) {
pagination.ReadParam(params)
req := NewRequest(http.MethodGet, "/api/v1/transaction-history", params)
return as.Call(req)
}