From 24d23e0784e217a2e56dd479622d7625d046b3f8 Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Thu, 2 Feb 2023 12:46:49 +0000 Subject: [PATCH] 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';