Skip to content

Invalid Types/Outdated Types for OrderInfo->BasicOrderInfo #115

@raaaaayn

Description

@raaaaayn

Serde Json Serialization Error:

the function info_client.historical_orders sometimes fails to serialize with the error

JsonParse("invalid type: null, expected a string at line 1 column 640")

Looks like some Orders have the field tif as null which is incompatible with the current definition of BasicOrderInfo

pub struct BasicOrderInfo {
    pub coin: String,
    //  ...
    //
    pub tif: String
    //  ...
}

actual json response

{
	"order": {
		"coin": "HYPE",
		"side": "A",
		"limitPx": "34.207",
		"sz": "3.07",
		"oid": 103970286169,
		"timestamp": 1750316991250,
		"triggerCondition": "Price below 37.182",
		"isTrigger": true,
		"triggerPx": "37.182",
		"children": [],
		"isPositionTpsl": false,
		"reduceOnly": true,
		"orderType": "Stop Market",
		"origSz": "3.07",
		"tif": null,
		"cloid": null
	},
	"status": "canceled",
	"statusTimestamp": 1750317630330
}

A simple change to the below would fix it

pub tif: Option<String>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions