mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
max: improve max deposit status string
This commit is contained in:
parent
82948c5c7f
commit
af3a105e70
|
@ -937,6 +937,14 @@ func (e *Exchange) QueryDepositHistory(
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toRawStatusStr := func(d maxapi.Deposit) string {
|
||||||
|
if len(d.StateReason) > 0 {
|
||||||
|
return fmt.Sprintf("%s (%s: %s)", d.Status, d.State, d.StateReason)
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf("%s (%s)", d.Status, d.State)
|
||||||
|
}
|
||||||
|
|
||||||
for i := len(deposits) - 1; i >= 0; i-- {
|
for i := len(deposits) - 1; i >= 0; i-- {
|
||||||
d := deposits[i]
|
d := deposits[i]
|
||||||
if _, ok := txIDs[d.TxID]; ok {
|
if _, ok := txIDs[d.TxID]; ok {
|
||||||
|
@ -954,7 +962,7 @@ func (e *Exchange) QueryDepositHistory(
|
||||||
Status: toGlobalDepositStatus(d.State),
|
Status: toGlobalDepositStatus(d.State),
|
||||||
Confirmation: strconv.FormatInt(d.Confirmations, 10),
|
Confirmation: strconv.FormatInt(d.Confirmations, 10),
|
||||||
Network: d.NetworkProtocol,
|
Network: d.NetworkProtocol,
|
||||||
RawStatus: fmt.Sprintf("%s (%s: %s)", d.Status, d.State, d.StateReason),
|
RawStatus: toRawStatusStr(d),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user