From 24d23e0784e217a2e56dd479622d7625d046b3f8 Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Thu, 2 Feb 2023 12:46:49 +0000 Subject: [PATCH 1/5] CFD schemas update package.json version was updated to 0.16.6-rc.1 --- package.json | 2 +- src/constants/positionStatuses.ts | 6 +++--- .../OrionAggregator/ws/schemas/addressUpdateSchema.ts | 2 ++ src/types.ts | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e048d11..2cfce34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.16.5", + "version": "0.16.6-rc.1", "description": "Orion Protocol SDK", "main": "./lib/esm/index.js", "module": "./lib/esm/index.js", diff --git a/src/constants/positionStatuses.ts b/src/constants/positionStatuses.ts index a4b0abe..09975f3 100644 --- a/src/constants/positionStatuses.ts +++ b/src/constants/positionStatuses.ts @@ -1,9 +1,9 @@ const positionStatuses = [ 'SHORT', 'LONG', - 'CLOSED', - 'LIQUIDATED', - 'NOT_OPEN', + 'CLOSING', + 'LIQUIDATION', + 'ZERO', ] as const; export default positionStatuses; diff --git a/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts b/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts index 715aeb7..c390f9d 100644 --- a/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts +++ b/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts @@ -32,6 +32,7 @@ export const orderUpdateSchema = z.object({ I: z.string(), // id A: z.number(), // settled amount S: z.enum(orderStatuses), // status + l: z.boolean().optional(), // is liquidation order t: z.number(), // update time c: subOrderSchema.array(), }) @@ -66,6 +67,7 @@ export const fullOrderSchema = z.object({ p: z.number(), // price F: z.string(), // fee asset f: z.number(), // fee + l: z.boolean().optional(), // is liquidation order o: z.boolean(), // internal only S: z.enum(orderStatuses), // status T: z.number(), // creation time / unix timestamp diff --git a/src/types.ts b/src/types.ts index e46ecc4..3c848de 100644 --- a/src/types.ts +++ b/src/types.ts @@ -26,6 +26,8 @@ export type Balance = { allowance: string, } +export type PositionStatus = 'SHORT' | 'LONG' | 'CLOSING' | 'LIQUIDATION' | 'ZERO'; + export type CFDBalance = { instrument: string, balance: string, @@ -235,5 +237,3 @@ export enum HistoryTransactionStatus { APPROVING = 'Approving', CANCELLED = 'Cancelled', } - -export type PositionStatus = 'SHORT' | 'LONG' | 'CLOSED' | 'LIQUIDATED' | 'NOT_OPEN'; From 42eb66c59471ea4b2a25a206b8a3439dd245faff Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Thu, 2 Feb 2023 12:49:05 +0000 Subject: [PATCH 2/5] CFD small schema update --- src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts b/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts index c390f9d..1850585 100644 --- a/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts +++ b/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts @@ -44,6 +44,7 @@ export const orderUpdateSchema = z.object({ id: o.I, settledAmount: o.A, status: o.S, + liquidated: o.l, subOrders: o.c.map((so) => ({ pair: so.P, exchange: so.e, @@ -82,6 +83,7 @@ export const fullOrderSchema = z.object({ settledAmount: o.A, feeAsset: o.F, fee: o.f, + liquidated: o.l, status: o.S, date: o.T, clientOrdId: o.O, From b500224b63ad9a8215f5c2c82d127f627323d91c Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Thu, 2 Feb 2023 12:53:35 +0000 Subject: [PATCH 3/5] package.json version was updated to 0.16.6-rc.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2cfce34..148b877 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.16.6-rc.1", + "version": "0.16.6-rc.2", "description": "Orion Protocol SDK", "main": "./lib/esm/index.js", "module": "./lib/esm/index.js", From d8b94fec7d9aa46281577ac684cbb5b9468a950f Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Thu, 2 Feb 2023 13:25:27 +0000 Subject: [PATCH 4/5] package.json version was updated to 0.16.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 148b877..610b55b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.16.6-rc.2", + "version": "0.16.6", "description": "Orion Protocol SDK", "main": "./lib/esm/index.js", "module": "./lib/esm/index.js", From bf937abad188b0aecdc22479a00e7449fc5f1943 Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Thu, 2 Feb 2023 14:59:42 +0000 Subject: [PATCH 5/5] Small type fix package.json version was updated to 0.16.7-rc.0 --- package.json | 2 +- src/types.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 610b55b..4f89879 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.16.6", + "version": "0.16.7-rc.0", "description": "Orion Protocol SDK", "main": "./lib/esm/index.js", "module": "./lib/esm/index.js", diff --git a/src/types.ts b/src/types.ts index 3c848de..c9fddfb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,6 +1,7 @@ import BigNumber from 'bignumber.js'; import exchanges from './constants/exchanges'; import subOrderStatuses from './constants/subOrderStatuses'; +import positionStatuses from './constants/positionStatuses'; export type AssetPairUpdate = { minQty: number, @@ -26,7 +27,7 @@ export type Balance = { allowance: string, } -export type PositionStatus = 'SHORT' | 'LONG' | 'CLOSING' | 'LIQUIDATION' | 'ZERO'; +export type PositionStatus = typeof positionStatuses[number]; export type CFDBalance = { instrument: string,