binance: store raw deposit status

This commit is contained in:
c9s 2024-11-11 17:41:29 +08:00
parent a9c51e824d
commit 85cb99802f
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 8 additions and 1 deletions

View File

@ -622,12 +622,16 @@ func (e *Exchange) QueryDepositHistory(ctx context.Context, asset string, since,
}
for _, d := range records {
// 0(0:pending,6: credited but cannot withdraw, 1:success)
// 0(0:pending,6: credited but cannot withdraw, 7=Wrong Deposit,8=Waiting User confirm, 1:success)
// set the default status
status := types.DepositStatus(fmt.Sprintf("code: %d", d.Status))
// https://www.binance.com/en/support/faq/115003736451
switch d.Status {
case binanceapi.DepositStatusWrong:
status = types.DepositRejected
case binanceapi.DepositStatusPending:
status = types.DepositPending
@ -647,6 +651,7 @@ func (e *Exchange) QueryDepositHistory(ctx context.Context, asset string, since,
AddressTag: d.AddressTag,
TransactionID: d.TxId,
Status: status,
RawStatus: strconv.Itoa(int(d.Status)),
UnlockConfirm: d.UnlockConfirm,
Confirmation: d.ConfirmTimes,
})

View File

@ -39,6 +39,8 @@ type Deposit struct {
TransactionID string `json:"transactionID" db:"txn_id"`
Status DepositStatus `json:"status"`
RawStatus string `json:"rawStatus"`
// Required confirm for unlock balance
UnlockConfirm int `json:"unlockConfirm"`