adshao / go-binance

A Go SDK for Binance API
MIT License
1.48k stars 664 forks source link

Update TradeID type to int64 #500

Closed orchidknight closed 11 months ago

orchidknight commented 11 months ago

Got an error, when create order on 32bit system. Err: binance.CreateOrderResponse.Fills: []*binance.Fill: binance.Fill.TradeID: ReadInt32: overflow: 3183180150, error found in #10 byte of ...|3183180150}],"selfTr|..., bigger context ...|3587","commissionAsset":"BNB","tradeId":3183180150}],"selfTradePreventionMode":"NONE"}|...

Need to change the type of field TradeID from int to int64, because this field no longer places identifiers in systems where int is interpreted as int32. As a result, the order is created on Binance, but due to the fact that unmarshaling is broken, we cannot receive a correct response.

adshao commented 11 months ago

@orchidknight thank you, please also fix the check and unit test error here