max: add withdraw status convert function for v3

This commit is contained in:
c9s 2024-08-05 16:39:44 +08:00
parent 00091e1ce1
commit 5d65b817ef
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -341,6 +341,26 @@ func convertWebSocketOrderUpdate(u max.OrderUpdate) (*types.Order, error) {
}, nil
}
func convertWithdrawStatusV3(status max.WithdrawStatus) types.WithdrawStatus {
switch status {
case max.WithdrawStatusPending:
return types.WithdrawStatusSent
case max.WithdrawStatusOK:
return types.WithdrawStatusCompleted
case max.WithdrawStatusFailed:
return types.WithdrawStatusFailed
case max.WithdrawStatusCancelled:
return types.WithdrawStatusCancelled
}
return types.WithdrawStatus(status)
}
func convertWithdrawStatus(state max.WithdrawState) types.WithdrawStatus {
switch state {