@drift-labs/sdk 2.97.0-beta.14 → 2.97.0-beta.16
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/VERSION +1 -1
- package/lib/decode/user.js +10 -0
- package/package.json +1 -1
- package/src/decode/user.ts +11 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.97.0-beta.
|
|
1
|
+
2.97.0-beta.16
|
package/lib/decode/user.js
CHANGED
|
@@ -296,6 +296,15 @@ function decodeUser(buffer) {
|
|
|
296
296
|
offset += 1;
|
|
297
297
|
const hasOpenAuction = buffer.readUInt8(offset) === 1;
|
|
298
298
|
offset += 1;
|
|
299
|
+
let marginMode;
|
|
300
|
+
const marginModeNum = buffer.readUInt8(offset);
|
|
301
|
+
if (marginModeNum === 0) {
|
|
302
|
+
marginMode = __1.MarginMode.DEFAULT;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
marginMode = __1.MarginMode.HIGH_LEVERAGE;
|
|
306
|
+
}
|
|
307
|
+
offset += 1;
|
|
299
308
|
// @ts-ignore
|
|
300
309
|
return {
|
|
301
310
|
authority,
|
|
@@ -324,6 +333,7 @@ function decodeUser(buffer) {
|
|
|
324
333
|
hasOpenOrder,
|
|
325
334
|
openAuctions,
|
|
326
335
|
hasOpenAuction,
|
|
336
|
+
marginMode,
|
|
327
337
|
};
|
|
328
338
|
}
|
|
329
339
|
exports.decodeUser = decodeUser;
|
package/package.json
CHANGED
package/src/decode/user.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
UserAccount,
|
|
12
12
|
} from '../types';
|
|
13
13
|
import { PublicKey } from '@solana/web3.js';
|
|
14
|
-
import { BN } from '../';
|
|
14
|
+
import { BN, MarginMode } from '../';
|
|
15
15
|
import { ZERO } from '../';
|
|
16
16
|
|
|
17
17
|
function readUnsignedBigInt64LE(buffer: Buffer, offset: number): BN {
|
|
@@ -326,6 +326,15 @@ export function decodeUser(buffer: Buffer): UserAccount {
|
|
|
326
326
|
const hasOpenAuction = buffer.readUInt8(offset) === 1;
|
|
327
327
|
offset += 1;
|
|
328
328
|
|
|
329
|
+
let marginMode: MarginMode;
|
|
330
|
+
const marginModeNum = buffer.readUInt8(offset);
|
|
331
|
+
if (marginModeNum === 0) {
|
|
332
|
+
marginMode = MarginMode.DEFAULT;
|
|
333
|
+
} else {
|
|
334
|
+
marginMode = MarginMode.HIGH_LEVERAGE;
|
|
335
|
+
}
|
|
336
|
+
offset += 1;
|
|
337
|
+
|
|
329
338
|
// @ts-ignore
|
|
330
339
|
return {
|
|
331
340
|
authority,
|
|
@@ -354,5 +363,6 @@ export function decodeUser(buffer: Buffer): UserAccount {
|
|
|
354
363
|
hasOpenOrder,
|
|
355
364
|
openAuctions,
|
|
356
365
|
hasOpenAuction,
|
|
366
|
+
marginMode,
|
|
357
367
|
};
|
|
358
368
|
}
|