-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwallet.go
44 lines (36 loc) · 1.67 KB
/
wallet.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
package igcclient
import (
"fmt"
"net/http"
"net/url"
"github.com/moonwalker/igcclient/models"
"github.com/moonwalker/logger"
)
type WalletService service
// Gets the users OM wallet
func (s *WalletService) GetOMWallet(headers map[string]string, log logger.Logger) (response models.OperationResponseOfOMUserWalletPublic, err error) {
err = s.client.apiReq(http.MethodPost, "/wallet/getomwallet", nil, nil, &response, &headers, log)
return
}
// Gets the current OM bonus
func (s *WalletService) GetOMCurrentBonus(headers map[string]string, log logger.Logger) (response models.OperationResponseOfBonus, err error) {
err = s.client.apiReq(http.MethodPost, "/wallet/getomcurrentbonus", nil, nil, &response, &headers, log)
return
}
// Gets the User Wallet
func (s *WalletService) Wallet(headers map[string]string, log logger.Logger) (response models.OperationResponseOfUserWalletPublic, err error) {
err = s.client.apiReq(http.MethodPost, "/wallet", nil, nil, &response, &headers, log)
return
}
// Gets the User Wallet
func (s *WalletService) WalletByUserID(userID int64, headers map[string]string, log logger.Logger) (response models.OperationResponseOfUserWalletPublic, err error) {
q := url.Values{}
q.Add("userid", fmt.Sprintf("%d", userID))
err = s.client.apiReq(http.MethodPost, "/wallet", &q, nil, &response, &headers, log)
return
}
// No documentation available.
func (s *WalletService) Transactions(body models.WalletTransactionsSearchModel, headers map[string]string, log logger.Logger) (response models.OperationResponseOfIEnumerableOfWalletTransactionsModel, err error) {
err = s.client.apiReq(http.MethodPost, "/wallet/transactions", nil, &body, &response, &headers, log)
return
}