Skip to content

Commit

Permalink
Merge pull request #1695 from c9s/c9s/max/fix-deposit-history-query-api
Browse files Browse the repository at this point in the history
FIX: [max] fix GetDepositHistoryRequest
  • Loading branch information
c9s authored Aug 16, 2024
2 parents 7488a10 + b88aff6 commit 098de22
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
5 changes: 3 additions & 2 deletions pkg/exchange/max/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,7 @@ func (e *Exchange) QueryWithdrawHistory(

withdraws, err := req.
Timestamp(startTime).
Order("asc").
Limit(limit).
Do(ctx)

Expand Down Expand Up @@ -927,8 +928,8 @@ func (e *Exchange) QueryDepositHistory(
}

deposits, err := req.
From(startTime).
To(endTime).
Timestamp(startTime).
Order("asc").
Limit(limit).
Do(ctx)

Expand Down
14 changes: 8 additions & 6 deletions pkg/exchange/max/maxapi/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,17 @@ type Deposit struct {
UpdatedAt types.MillisecondTimestamp `json:"updated_at"`
}

//go:generate GetRequest -url "v2/deposits" -type GetDepositHistoryRequest -responseType []Deposit
//go:generate GetRequest -url "v3/deposits" -type GetDepositHistoryRequest -responseType []Deposit
type GetDepositHistoryRequest struct {
client requestgen.AuthenticatedAPIClient

currency *string `param:"currency"`
from *time.Time `param:"from,seconds"` // seconds
to *time.Time `param:"to,seconds"` // seconds
state *string `param:"state"` // submitting, submitted, rejected, accepted, checking, refunded, canceled, suspect
limit *int `param:"limit"`
currency *string `param:"currency"`
timestamp *time.Time `param:"timestamp,milliseconds"` // seconds
state *string `param:"state"` // submitting, submitted, rejected, accepted, checking, refunded, canceled, suspect

order *string `param:"order"`

limit *int `param:"limit"`
}

func (c *RestClient) NewGetDepositHistoryRequest() *GetDepositHistoryRequest {
Expand Down
45 changes: 22 additions & 23 deletions pkg/exchange/max/maxapi/get_deposit_history_request_requestgen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 098de22

Please sign in to comment.