@drift-labs/jit-proxy 0.17.1 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/jitter/baseJitter.js +10 -9
- package/package.json +2 -2
- package/src/jitter/baseJitter.ts +5 -2
package/lib/jitter/baseJitter.js
CHANGED
|
@@ -88,7 +88,7 @@ class BaseJitter {
|
|
|
88
88
|
});
|
|
89
89
|
await ((_a = this.slotSubscriber) === null || _a === void 0 ? void 0 : _a.subscribe());
|
|
90
90
|
await ((_b = this.swiftOrderSubscriber) === null || _b === void 0 ? void 0 : _b.subscribe(async (orderMessageRaw, signedMessage, isDelegateSigner) => {
|
|
91
|
-
var _a, _b, _c, _d, _e, _f
|
|
91
|
+
var _a, _b, _c, _d, _e, _f;
|
|
92
92
|
const signedMsgOrderParams = signedMessage.signedMsgOrderParams;
|
|
93
93
|
if (!signedMsgOrderParams.auctionDuration ||
|
|
94
94
|
!signedMsgOrderParams.auctionStartPrice ||
|
|
@@ -125,22 +125,23 @@ class BaseJitter {
|
|
|
125
125
|
auctionDuration: signedMsgOrderParams.auctionDuration,
|
|
126
126
|
auctionStartPrice: signedMsgOrderParams.auctionStartPrice,
|
|
127
127
|
auctionEndPrice: signedMsgOrderParams.auctionEndPrice,
|
|
128
|
-
immediateOrCancel: (
|
|
128
|
+
immediateOrCancel: (signedMsgOrderParams.bitFlags &
|
|
129
|
+
sdk_1.OrderParamsBitFlag.ImmediateOrCancel) !== 0,
|
|
130
|
+
bitFlags: signedMsgOrderParams.bitFlags,
|
|
129
131
|
direction: signedMsgOrderParams.direction,
|
|
130
132
|
postOnly: false,
|
|
131
|
-
oraclePriceOffset: (
|
|
132
|
-
maxTs: (
|
|
133
|
-
reduceOnly: (
|
|
134
|
-
triggerCondition: (
|
|
135
|
-
price: (
|
|
136
|
-
userOrderId: (
|
|
133
|
+
oraclePriceOffset: (_a = signedMsgOrderParams.oraclePriceOffset) !== null && _a !== void 0 ? _a : 0,
|
|
134
|
+
maxTs: (_b = signedMsgOrderParams.maxTs) !== null && _b !== void 0 ? _b : sdk_1.ZERO,
|
|
135
|
+
reduceOnly: (_c = signedMsgOrderParams.reduceOnly) !== null && _c !== void 0 ? _c : false,
|
|
136
|
+
triggerCondition: (_d = signedMsgOrderParams.triggerCondition) !== null && _d !== void 0 ? _d : sdk_1.OrderTriggerCondition.ABOVE,
|
|
137
|
+
price: (_e = signedMsgOrderParams.price) !== null && _e !== void 0 ? _e : sdk_1.ZERO,
|
|
138
|
+
userOrderId: (_f = signedMsgOrderParams.userOrderId) !== null && _f !== void 0 ? _f : 0,
|
|
137
139
|
// Rest are not necessary and set for type conforming
|
|
138
140
|
existingPositionDirection: sdk_1.PositionDirection.LONG,
|
|
139
141
|
triggerPrice: sdk_1.ZERO,
|
|
140
142
|
baseAssetAmountFilled: sdk_1.ZERO,
|
|
141
143
|
quoteAssetAmountFilled: sdk_1.ZERO,
|
|
142
144
|
quoteAssetAmount: sdk_1.ZERO,
|
|
143
|
-
bitFlags: 0,
|
|
144
145
|
postedSlotTail: 0,
|
|
145
146
|
};
|
|
146
147
|
if (this.userFilter) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drift-labs/jit-proxy",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"clean": "rm -rf lib",
|
|
6
6
|
"build": "yarn clean && tsc"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@coral-xyz/anchor": "0.26.0",
|
|
10
|
-
"@drift-labs/sdk": "2.
|
|
10
|
+
"@drift-labs/sdk": "2.120.0-beta.0",
|
|
11
11
|
"@solana/web3.js": "1.91.7",
|
|
12
12
|
"tweetnacl-util": "^0.15.1"
|
|
13
13
|
},
|
package/src/jitter/baseJitter.ts
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
OrderTriggerCondition,
|
|
27
27
|
SignedMsgOrderParamsDelegateMessage,
|
|
28
28
|
SignedMsgOrderParamsMessage,
|
|
29
|
+
OrderParamsBitFlag,
|
|
29
30
|
} from '@drift-labs/sdk';
|
|
30
31
|
import { decodeUTF8 } from 'tweetnacl-util';
|
|
31
32
|
|
|
@@ -272,7 +273,10 @@ export abstract class BaseJitter {
|
|
|
272
273
|
auctionDuration: signedMsgOrderParams.auctionDuration,
|
|
273
274
|
auctionStartPrice: signedMsgOrderParams.auctionStartPrice,
|
|
274
275
|
auctionEndPrice: signedMsgOrderParams.auctionEndPrice,
|
|
275
|
-
immediateOrCancel:
|
|
276
|
+
immediateOrCancel:
|
|
277
|
+
(signedMsgOrderParams.bitFlags &
|
|
278
|
+
OrderParamsBitFlag.ImmediateOrCancel) !== 0,
|
|
279
|
+
bitFlags: signedMsgOrderParams.bitFlags,
|
|
276
280
|
direction: signedMsgOrderParams.direction,
|
|
277
281
|
postOnly: false,
|
|
278
282
|
oraclePriceOffset: signedMsgOrderParams.oraclePriceOffset ?? 0,
|
|
@@ -289,7 +293,6 @@ export abstract class BaseJitter {
|
|
|
289
293
|
baseAssetAmountFilled: ZERO,
|
|
290
294
|
quoteAssetAmountFilled: ZERO,
|
|
291
295
|
quoteAssetAmount: ZERO,
|
|
292
|
-
bitFlags: 0,
|
|
293
296
|
postedSlotTail: 0,
|
|
294
297
|
};
|
|
295
298
|
|