Support amount-specific negative-risk redemptions and wallet receipts
This commit is contained in:
@@ -178,6 +178,8 @@ pub(crate) enum Command {
|
||||
Redeem {
|
||||
market: String,
|
||||
account: String,
|
||||
#[serde(default, deserialize_with = "redeem_amounts")]
|
||||
amounts_micros: Option<[i64; 2]>,
|
||||
},
|
||||
Resolve {
|
||||
market: String,
|
||||
@@ -194,3 +196,10 @@ pub(crate) enum TimeInForce {
|
||||
Fak,
|
||||
Fok,
|
||||
}
|
||||
|
||||
// Only an omitted field selects full redemption. An explicit null must not spend a balance.
|
||||
fn redeem_amounts<'de, D: serde::Deserializer<'de>>(
|
||||
input: D,
|
||||
) -> Result<Option<[i64; 2]>, D::Error> {
|
||||
<[i64; 2]>::deserialize(input).map(Some)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user