multiple exchanges in suborder

This commit is contained in:
Kirill Litvinov
2023-09-26 14:03:27 +03:00
parent 86944a3273
commit 276b1beec8
4 changed files with 7 additions and 3 deletions

View File

@@ -87,6 +87,7 @@ const subOrderSchema = baseOrderSchema.extend({
message: `subOrder.parentOrderId must be a hex string, got ${value}`,
})),
exchange: z.string(),
exchanges: z.string().array().optional(),
brokerAddress: brokerAddressSchema,
tradesInfo: z.record(
z.string().uuid(),

View File

@@ -23,6 +23,7 @@ const subOrderSchema = z.object({
A: z.number(), // settled amount
p: z.number(), // avg weighed settlement price
e: z.string(), // exchange
es: z.string().array().optional(), // exchanges
b: z.string(), // broker address
S: z.enum(subOrderStatuses), // status
o: z.boolean(), // internal only
@@ -52,6 +53,7 @@ export const orderUpdateSchema = z.object({
subOrders: o.c.map((so) => ({
pair: so.P,
exchange: so.e,
exchanges: so.es,
id: so.i,
amount: so.a,
settledAmount: so.A,
@@ -106,6 +108,7 @@ export const fullOrderSchema = z.object({
subOrders: o.c.map((so) => ({
pair: so.P,
exchange: so.e,
exchangs: so.es,
id: so.i,
amount: so.a,
settledAmount: so.A,