import BN from "bn.js"; import { PublicKey } from "@solana/web3.js"; import { MarginfiAccountRaw, BalanceRaw, BalanceType, AccountFlags, HealthCacheFlags, MarginfiAccountTypeDto, MarginfiAccountType, BalanceTypeDto, HealthCacheTypeDto, HealthCacheType } from "../types"; import { MarginfiIdlType } from "../../../idl"; import { Balance } from "../../../models/balance"; import { HealthCache } from "../../../models/health-cache"; export declare function decodeAccountRaw(encoded: Buffer, idl: MarginfiIdlType): MarginfiAccountRaw; export declare function parseBalanceRaw(balanceRaw: BalanceRaw): BalanceType; export declare function parseMarginfiAccountRaw(marginfiAccountPk: PublicKey, accountData: MarginfiAccountRaw): { address: PublicKey; group: PublicKey; authority: PublicKey; balances: Balance[]; accountFlags: AccountFlags[]; emissionsDestinationAccount: PublicKey; healthCache: HealthCache; }; /** * Get all active account flags as an array of flag names */ export declare function getActiveAccountFlags(flags: BN): AccountFlags[]; /** * Check if an account flag is set */ export declare function hasAccountFlag(flags: BN, flag: number): boolean; /** * Convert on-chain health cache flags (BN) to an array of HealthCacheFlags enum values * * According to the IDL, health cache flags are defined as: * - HEALTHY = 1 (bit 0) - If set, the account cannot be liquidated * - ENGINE_STATUS_OK = 2 (bit 1) - If set, the engine did not error during health calculation * - ORACLE_OK = 4 (bit 2) - If set, the engine did not encounter oracle issues */ export declare function getActiveHealthCacheFlags(flags: number): HealthCacheFlags[]; /** * Check if a health cache flag is set */ export declare function hasHealthCacheFlag(flags: number, flag: HealthCacheFlags): boolean; /** * Convert numeric health cache flags to a human-readable status message */ export declare function getHealthCacheStatusDescription(flags: number): string; export declare function dtoToMarginfiAccount(marginfiAccountDto: MarginfiAccountTypeDto): MarginfiAccountType; export declare function dtoToBalance(balanceDto: BalanceTypeDto): BalanceType; export declare function dtoToHealthCache(healthCacheDto: HealthCacheTypeDto): HealthCacheType; //# sourceMappingURL=deserialize.utils.d.ts.map