We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 803fc32 commit 90cd65dCopy full SHA for 90cd65d
sdk/src/decode/user.ts
@@ -338,8 +338,15 @@ export function decodeUser(buffer: Buffer): UserAccount {
338
const marginModeNum = buffer.readUInt8(offset);
339
if (marginModeNum === 0) {
340
marginMode = MarginMode.DEFAULT;
341
- } else {
+ } else if (marginModeNum === 1) {
342
marginMode = MarginMode.HIGH_LEVERAGE;
343
+ } else if (marginModeNum === 2) {
344
+ marginMode = MarginMode.HIGH_LEVERAGE_MAINTENANCE;
345
+ } else {
346
+ console.error(
347
+ `Detected unknown margin mode: ${marginModeNum}. Please update @drift-labs/sdk for latest IDL.`
348
+ );
349
+ marginMode = MarginMode.DEFAULT;
350
}
351
offset += 1;
352
0 commit comments