Support amount-specific negative-risk redemptions and wallet receipts
This commit is contained in:
@@ -117,11 +117,15 @@ impl Filter {
|
||||
} else {
|
||||
crate::inventory::decimal(gross, 10000)
|
||||
};
|
||||
items.push(json!({"type":r.get::<_,String>(5)?,"account":self.account,"at_ms":r.get::<_,Option<i64>>(4)?,
|
||||
let mut item = json!({"type":r.get::<_,String>(5)?,"account":self.account,"at_ms":r.get::<_,Option<i64>>(4)?,
|
||||
"market":market,"group":r.get::<_,Option<String>>(7)?,"asset_id":asset,"outcome":outcome,
|
||||
"shares":shares,"cash_delta_cents":cash_cents,"fee_micros":fee,"net_cash_delta_micros":gross-i128::from(fee),
|
||||
"side":r.get::<_,Option<String>>(12)?,"price_micros":r.get::<_,Option<i64>>(13)?.map(|p|p*100),
|
||||
"request_id":r.get::<_,Option<String>>(10)?,"execution":(source==1).then_some(seq),"order":(source==1).then_some(leg)}));
|
||||
"request_id":r.get::<_,Option<String>>(10)?,"execution":(source==1).then_some(seq),"order":(source==1).then_some(leg)});
|
||||
if let Some(raw) = r.get::<_, Option<String>>(17)? {
|
||||
item["amounts_micros"] = serde_json::from_str(&raw)?;
|
||||
}
|
||||
items.push(item);
|
||||
last = Some(Cursor {
|
||||
asc,
|
||||
key: (r.get(0)?, source, seq, leg),
|
||||
|
||||
Reference in New Issue
Block a user