Skip to content
forked from c9s/bbgo

Commit

Permalink
max: fix withdraw state convert by calling convertWithdrawStatusV2
Browse files Browse the repository at this point in the history
v3 api does not return status field
  • Loading branch information
c9s committed Aug 7, 2024
1 parent ffb2c14 commit 25b0b5d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/exchange/max/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func convertWithdrawStatusV3(status max.WithdrawStatus) types.WithdrawStatus {
return types.WithdrawStatus(status)
}

func convertWithdrawStatus(state max.WithdrawState) types.WithdrawStatus {
func convertWithdrawStatusV2(state max.WithdrawState) types.WithdrawStatus {
switch state {

case max.WithdrawStateSent, max.WithdrawStateSubmitting, max.WithdrawStatePending, "accepted", "approved":
Expand Down
3 changes: 1 addition & 2 deletions pkg/exchange/max/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,7 @@ func (e *Exchange) QueryWithdrawHistory(
continue
}

// we can convert this later
status := convertWithdrawStatusV3(d.Status)
status := convertWithdrawStatusV2(d.State)

txIDs[d.TxID] = struct{}{}
withdraw := types.Withdraw{
Expand Down
2 changes: 1 addition & 1 deletion pkg/exchange/max/maxapi/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ type Withdraw struct {
// "sygna_verifying"
State WithdrawState `json:"state"`

Status WithdrawStatus `json:"status,omitempty"`
// Status WithdrawStatus `json:"status,omitempty"`

CreatedAt types.MillisecondTimestamp `json:"created_at"`
UpdatedAt types.MillisecondTimestamp `json:"updated_at"`
Expand Down

0 comments on commit 25b0b5d

Please sign in to comment.