diff --git a/pkg/exchange/okex/convert.go b/pkg/exchange/okex/convert.go index d1b0074cc..47e2f0a11 100644 --- a/pkg/exchange/okex/convert.go +++ b/pkg/exchange/okex/convert.go @@ -401,7 +401,7 @@ Status of deposit 13: Sub-account deposit interception 14: KYC limit */ -func toDepositStatusMessage(state types.StrInt64) string { +func toDepositStatusMessage(state int64) string { switch state { case 0: return "Waiting for confirmation" @@ -424,7 +424,7 @@ func toDepositStatusMessage(state types.StrInt64) string { return "" } -func toGlobalDepositStatus(state types.StrInt64) types.DepositStatus { +func toGlobalDepositStatus(state int64) types.DepositStatus { switch state { case 0: return types.DepositPending @@ -448,8 +448,8 @@ func toGlobalDeposit(record okexapi.DepositRecord) types.Deposit { Address: record.To, AddressTag: "", TransactionID: record.DepId, - Status: toGlobalDepositStatus(record.State), - RawStatus: record.State.String(), + Status: toGlobalDepositStatus(int64(record.State)), + RawStatus: fmt.Sprintf("%s (%s)", record.State.String(), toDepositStatusMessage(int64(record.State))), UnlockConfirm: 0, Confirmation: record.ActualDepBlkConfirm.String(), Network: strings.ToUpper(record.Chain), diff --git a/pkg/strategy/xalign/strategy.go b/pkg/strategy/xalign/strategy.go index d57a94dd1..8da38023f 100644 --- a/pkg/strategy/xalign/strategy.go +++ b/pkg/strategy/xalign/strategy.go @@ -152,7 +152,7 @@ func (s *Strategy) detectActiveWithdraw( until := time.Now() since := until.Add(-time.Hour * 24) for _, session := range sessions { - transferService, ok := session.Exchange.(types.ExchangeTransferHistoryService) + transferService, ok := session.Exchange.(types.WithdrawHistoryService) if !ok { continue } @@ -184,7 +184,7 @@ func (s *Strategy) detectActiveDeposit( until := time.Now() since := until.Add(-time.Hour * 24) for _, session := range sessions { - transferService, ok := session.Exchange.(types.ExchangeTransferHistoryService) + transferService, ok := session.Exchange.(types.DepositHistoryService) if !ok { continue } diff --git a/pkg/types/exchange.go b/pkg/types/exchange.go index 6aaa1e886..0576b706a 100644 --- a/pkg/types/exchange.go +++ b/pkg/types/exchange.go @@ -145,11 +145,19 @@ type CustomIntervalProvider interface { IsSupportedInterval(interval Interval) bool } -type ExchangeTransferHistoryService interface { +type DepositHistoryService interface { QueryDepositHistory(ctx context.Context, asset string, since, until time.Time) (allDeposits []Deposit, err error) +} + +type WithdrawHistoryService interface { QueryWithdrawHistory(ctx context.Context, asset string, since, until time.Time) (allWithdraws []Withdraw, err error) } +type ExchangeTransferHistoryService interface { + DepositHistoryService + WithdrawHistoryService +} + type ExchangeTransferService interface { QueryDepositHistory(ctx context.Context, asset string, since, until time.Time) (allDeposits []Deposit, err error) QueryWithdrawHistory(ctx context.Context, asset string, since, until time.Time) (allWithdraws []Withdraw, err error)