Add new stop limit schemas

This commit is contained in:
Mikhail Gladchenko
2023-03-01 16:22:37 +00:00
parent a7c74abb64
commit 37a2db3edd
4 changed files with 14 additions and 1 deletions

View File

@@ -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,13 @@ export const signCFDOrder = async (
nonce,
expiration,
buySide: side === 'BUY' ? 1 : 0,
stopPrice: stopPrice !== undefined
? normalizeNumber(
stopPrice,
INTERNAL_ORION_PRECISION,
BigNumber.ROUND_FLOOR,
).toNumber()
: undefined,
isPersonalSign: usePersonalSign,
};