mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
Added reverse order to placeOrder
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@orionprotocol/sdk",
|
"name": "@orionprotocol/sdk",
|
||||||
"version": "0.19.20",
|
"version": "0.19.25-rc1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@orionprotocol/sdk",
|
"name": "@orionprotocol/sdk",
|
||||||
"version": "0.19.20",
|
"version": "0.19.25-rc1",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.21.0",
|
"@babel/runtime": "^7.21.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@orionprotocol/sdk",
|
"name": "@orionprotocol/sdk",
|
||||||
"version": "0.19.24",
|
"version": "0.19.25-rc1",
|
||||||
"description": "Orion Protocol SDK",
|
"description": "Orion Protocol SDK",
|
||||||
"main": "./lib/index.cjs",
|
"main": "./lib/index.cjs",
|
||||||
"module": "./lib/index.js",
|
"module": "./lib/index.js",
|
||||||
@@ -108,4 +108,4 @@
|
|||||||
"overrides": {
|
"overrides": {
|
||||||
"tsconfig-paths": "^4.0.0"
|
"tsconfig-paths": "^4.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,11 +181,15 @@ class Aggregator {
|
|||||||
placeOrder = (
|
placeOrder = (
|
||||||
signedOrder: SignedOrder,
|
signedOrder: SignedOrder,
|
||||||
isCreateInternalOrder: boolean,
|
isCreateInternalOrder: boolean,
|
||||||
|
isReversedOrder?: boolean,
|
||||||
partnerId?: string,
|
partnerId?: string,
|
||||||
) => {
|
) => {
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
|
...(isReversedOrder !== undefined) && {
|
||||||
|
'X-Reverse-Order': isReversedOrder ? 'true' : 'false',
|
||||||
|
},
|
||||||
...(partnerId !== undefined) && { 'X-Partner-Id': partnerId },
|
...(partnerId !== undefined) && { 'X-Partner-Id': partnerId },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ export const fullOrderSchema = z.object({
|
|||||||
c: subOrderSchema.array(),
|
c: subOrderSchema.array(),
|
||||||
E: z.enum(executionTypes).optional(), // execution type
|
E: z.enum(executionTypes).optional(), // execution type
|
||||||
C: z.string().optional(), // trigger condition
|
C: z.string().optional(), // trigger condition
|
||||||
|
ro: z.boolean(), // is reversed order
|
||||||
}).transform((val) => ({
|
}).transform((val) => ({
|
||||||
...val,
|
...val,
|
||||||
k: 'full' as const,
|
k: 'full' as const,
|
||||||
@@ -102,6 +103,7 @@ export const fullOrderSchema = z.object({
|
|||||||
price: o.p,
|
price: o.p,
|
||||||
executionType: o.E,
|
executionType: o.E,
|
||||||
triggerCondition: o.C,
|
triggerCondition: o.C,
|
||||||
|
isReversedOrder: o.ro,
|
||||||
subOrders: o.c.map((so) => ({
|
subOrders: o.c.map((so) => ({
|
||||||
pair: so.P,
|
pair: so.P,
|
||||||
exchange: so.e,
|
exchange: so.e,
|
||||||
|
|||||||
Reference in New Issue
Block a user