version changes

This commit is contained in:
Justin Starry 2021-01-08 23:37:26 +08:00
parent 315d9304e8
commit 55784109e1
3 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,7 @@ import * as Layout from "./../../utils/layout";
export const LendingMarketLayout: typeof BufferLayout.Structure = BufferLayout.struct(
[
BufferLayout.u8("isInitialized"),
BufferLayout.u8("version"),
Layout.publicKey("quoteMint"),
Layout.publicKey("tokenProgramId")
],
@ -17,7 +17,7 @@ export interface LendingMarket {
}
export const isLendingMarket = (info: AccountInfo<Buffer>) => {
return info.data.length === LendingMarketLayout.span;
return info.data.length === LendingMarketLayout.span + 62;
};
export const LendingMarketParser = (

View File

@ -5,6 +5,7 @@ import * as Layout from "./../../utils/layout";
export const LendingObligationLayout: typeof BufferLayout.Structure = BufferLayout.struct(
[
BufferLayout.u8("version"),
/// Slot when obligation was updated. Used for calculating interest.
Layout.uint64("lastUpdateSlot"),
/// Amount of collateral tokens deposited for this obligation
@ -23,7 +24,7 @@ export const LendingObligationLayout: typeof BufferLayout.Structure = BufferLayo
);
export const isLendingObligation = (info: AccountInfo<Buffer>) => {
return info.data.length === LendingObligationLayout.span;
return info.data.length === LendingObligationLayout.span + 300;
};
export interface LendingObligation {

View File

@ -13,6 +13,7 @@ import * as Layout from './../../utils/layout';
import { LendingInstruction } from './lending';
export const LendingReserveLayout: typeof BufferLayout.Structure = BufferLayout.struct([
BufferLayout.u8('version'),
Layout.uint64('lastUpdateSlot'),
Layout.publicKey('lendingMarket'),
@ -76,7 +77,7 @@ export const LendingReserveLayout: typeof BufferLayout.Structure = BufferLayout.
]);
export const isLendingReserve = (info: AccountInfo<Buffer>) => {
return info.data.length === LendingReserveLayout.span;
return info.data.length === LendingReserveLayout.span + 300;
};
export interface LendingReserve {