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

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.84",
"version": "0.19.88-rc0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.19.84",
"version": "0.19.88-rc0",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.85",
"version": "0.19.88-rc0",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

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,