Fix hasBorrows memcmp

This commit is contained in:
Riordan Panayides 2021-06-15 22:44:33 +01:00
parent 5b36c32f3d
commit 1aae8a4178
1 changed files with 2 additions and 1 deletions

View File

@ -186,6 +186,7 @@ export class MarginAccount {
deposits!: number[];
borrows!: number[];
beingLiquidated!: boolean;
hasBorrows!: boolean;
openOrders!: PublicKey[];
openOrdersAccounts: (OpenOrders | undefined)[] // undefined if an openOrdersAccount not yet initialized and has zeroKey
@ -1436,7 +1437,7 @@ export class MangoClient {
return await this.getAllMarginAccounts(connection, programId, mangoGroup, [{
memcmp: {
offset: MarginAccountLayout.offsetOf('hasBorrows'),
bytes: 1
bytes: "2" // [1] base58 encoded
}
}])
}