diff --git a/package.json b/package.json index 5856d08..8377f5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.17.24", + "version": "0.17.25-rc.9", "description": "Orion Protocol SDK", "main": "./lib/esm/index.js", "module": "./lib/esm/index.js", diff --git a/src/crypt/signCFDOrder.ts b/src/crypt/signCFDOrder.ts index 358d4be..20c69ee 100644 --- a/src/crypt/signCFDOrder.ts +++ b/src/crypt/signCFDOrder.ts @@ -25,6 +25,7 @@ export const signCFDOrder = async ( usePersonalSign: boolean, signer: ethers.Signer, chainId: SupportedChainId, + stopPrice: BigNumber.Value | undefined, ) => { const nonce = Date.now(); const expiration = nonce + DEFAULT_EXPIRATION; @@ -51,6 +52,9 @@ export const signCFDOrder = async ( nonce, expiration, buySide: side === 'BUY' ? 1 : 0, + stopPrice: stopPrice !== undefined + ? new BigNumber(stopPrice).toNumber() + : undefined, isPersonalSign: usePersonalSign, }; diff --git a/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts b/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts index 1850585..583c684 100644 --- a/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts +++ b/src/services/OrionAggregator/ws/schemas/addressUpdateSchema.ts @@ -69,6 +69,7 @@ export const fullOrderSchema = z.object({ F: z.string(), // fee asset f: z.number(), // fee l: z.boolean().optional(), // is liquidation order + L: z.number().optional(), // stop limit price, o: z.boolean(), // internal only S: z.enum(orderStatuses), // status T: z.number(), // creation time / unix timestamp @@ -84,6 +85,7 @@ export const fullOrderSchema = z.object({ feeAsset: o.F, fee: o.f, liquidated: o.l, + stopPrice: o.L, status: o.S, date: o.T, clientOrdId: o.O, diff --git a/src/types.ts b/src/types.ts index 9eb900f..f49fa51 100644 --- a/src/types.ts +++ b/src/types.ts @@ -82,6 +82,7 @@ export type CFDOrder = { nonce: number // uint64 expiration: number // uint64 buySide: 0 | 1 // uint8, 1=buy, 0=sell + stopPrice?: number | undefined // uint64 isPersonalSign: boolean // bool }