mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
binance: store raw deposit status
This commit is contained in:
parent
a9c51e824d
commit
85cb99802f
|
@ -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,
|
||||
})
|
||||
|
|
|
@ -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"`
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user