max: deposit request currency field is optional

This commit is contained in:
c9s 2022-04-25 16:27:07 +08:00
parent fae3b6a215
commit 76012f0b71
No known key found for this signature in database
GPG Key ID: F0A7E4490F2EBC8C
2 changed files with 8 additions and 5 deletions

View File

@ -128,7 +128,7 @@ type Deposit struct {
type GetDepositHistoryRequest struct {
client requestgen.AuthenticatedAPIClient
currency string `param:"currency"`
currency *string `param:"currency"`
from *int64 `param:"from"` // seconds
to *int64 `param:"to"` // seconds
state *string `param:"state"` // submitting, submitted, rejected, accepted, checking, refunded, canceled, suspect

View File

@ -12,7 +12,7 @@ import (
)
func (g *GetDepositHistoryRequest) Currency(currency string) *GetDepositHistoryRequest {
g.currency = currency
g.currency = &currency
return g
}
@ -52,10 +52,13 @@ func (g *GetDepositHistoryRequest) GetQueryParameters() (url.Values, error) {
func (g *GetDepositHistoryRequest) GetParameters() (map[string]interface{}, error) {
var params = map[string]interface{}{}
// check currency field -> json key currency
currency := g.currency
if g.currency != nil {
currency := *g.currency
// assign parameter of currency
params["currency"] = currency
// assign parameter of currency
params["currency"] = currency
} else {
}
// check from field -> json key from
if g.from != nil {
from := *g.from