Added isReversedOrder param

This commit is contained in:
Aleksandr Kraiz
2023-06-02 16:31:37 +04:00
parent db7b9abbe4
commit f2d225a415
4 changed files with 6 additions and 3 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@orionprotocol/sdk", "name": "@orionprotocol/sdk",
"version": "0.19.19", "version": "0.19.20",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@orionprotocol/sdk", "name": "@orionprotocol/sdk",
"version": "0.19.19", "version": "0.19.20",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",

View File

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

View File

@@ -27,6 +27,7 @@ export const signOrder = async (
usePersonalSign: boolean, usePersonalSign: boolean,
signer: ethers.Signer, signer: ethers.Signer,
chainId: SupportedChainId, chainId: SupportedChainId,
isReversedOrder = false
) => { ) => {
const nonce = Date.now(); const nonce = Date.now();
const expiration = nonce + DEFAULT_EXPIRATION; const expiration = nonce + DEFAULT_EXPIRATION;
@@ -56,6 +57,7 @@ export const signOrder = async (
expiration, expiration,
buySide: side === 'BUY' ? 1 : 0, buySide: side === 'BUY' ? 1 : 0,
isPersonalSign: usePersonalSign, isPersonalSign: usePersonalSign,
isReversedOrder
}; };
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions // eslint-disable-next-line @typescript-eslint/consistent-type-assertions

View File

@@ -71,6 +71,7 @@ export type Order = {
expiration: number // uint64 expiration: number // uint64
buySide: 0 | 1 // uint8, 1=buy, 0=sell buySide: 0 | 1 // uint8, 1=buy, 0=sell
isPersonalSign: boolean // bool isPersonalSign: boolean // bool
isReversedOrder?: boolean | undefined // bool
} }
export type CFDOrder = { export type CFDOrder = {