From 1b8d7bd8056e8a4938930b0a5adbe013e4c28c66 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 4 Sep 2024 11:17:56 +0800 Subject: [PATCH] max: fix v3 deposit state conversion --- pkg/exchange/max/convert.go | 7 +++++++ pkg/exchange/max/maxapi/account.go | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/pkg/exchange/max/convert.go b/pkg/exchange/max/convert.go index 20b80e397..3f561b543 100644 --- a/pkg/exchange/max/convert.go +++ b/pkg/exchange/max/convert.go @@ -284,6 +284,13 @@ func toGlobalDepositStatus(a max.DepositState) types.DepositStatus { case max.DepositStateAccepted: return types.DepositSuccess + + case max.DepositStateProcessing: // v3 states + return types.DepositPending + + case max.DepositStateDone: // v3 states + return types.DepositSuccess + } // other states goes to this diff --git a/pkg/exchange/max/maxapi/account.go b/pkg/exchange/max/maxapi/account.go index a363a0449..ccf4c165b 100644 --- a/pkg/exchange/max/maxapi/account.go +++ b/pkg/exchange/max/maxapi/account.go @@ -116,6 +116,10 @@ const ( DepositStateSuspended DepositState = "suspended" DepositStateAccepted DepositState = "accepted" DepositStateChecking DepositState = "checking" + + // v3 states + DepositStateProcessing DepositState = "processing" + DepositStateDone DepositState = "done" ) type Deposit struct {