Closed noahbclarkson closed 5 months ago
On further testing it seems that on cancelling the order, the order_id is a String and on creating a new one the order_id is a u64. We will probably need to parse the order id from a u64 to a string or vice versa.
It only really matters for results, and so as to not disrupt existing code I added an optional serde https://github.com/Igosuki/binance-rs-async/commit/b21701344d93bf89fcdd2ad968f59ef8413548a4
Change order_id to String for
MarginOrderCancellation
andMarginOrderCacellationResult
because the API returns a String.When cancelling a Margin order the API will return:
error decoding response body: invalid type: string "xxxxxxxxxx", expected u64 at line 1 column 23
Effectively, this is because the
MarginOrderCancellation
andMarginOrderCancellationResult
structs have their order_id set to a u64 instead of a string when the API returns a string. It could also be possible to parse the String into a u64 because the default order ID is always a valid u64. However, users can pass a custom order_id into an order that can't be parsed into a u64 which suggests that this value should really be a String. Do what you will with this, but I'll be using this version of binance-rs-async until this is fixed.